If you want to try out Red Hat JBoss AMQ on OpenShift here's the current instructions:
If you want to use the OpenShift create application page, enter the cartridge URI of http://is.gd/Q5ihum in the entry field (at the bottom left of the form).
Or if you want to use the rhc command line type:
rhc create-app amq http://is.gd/Q5ihum
This will output the generated user-id/password, http management url and public self-signed certificate for the AMQ server. Make sure you copy and save all that information. You will need it later to connect messaging clients to the server.
If you prefer to specify your own password (which can be handy in development to reuse the same password across fabrics) try this:
rhc create-app -e OPENSHIFT_AMQ_PASSWORD=admin amq http://is.gd/Q5ihum
You probably want to use a safer password than 'admin' though ;) Also passwords require a minimum of 6 characters.
If you have a subscription for Openshift that gives you access to other gear sizes, you could run
rhc create-app -g medium -e OPENSHIFT_AMQ_PASSWORD=admin amq http://is.gd/Q5ihum
That will create the container in an Openshift gear of the specified size.
You can then login to your registry at: http://amq-$USERID.rhcloud.com/hawtio/ where $USERID is your openshift account name. Use the following login:
user: admin
password: $password
You can now use the Runtime and Configuration tabs and create containers etc.
Messaging clients MUST use SSL/TLS and set the SNI SSL header. All client libraries proved by AMQ 6.1 set this header when connecting via SSL. The JVM only supports setting the SNI header as of Java 7.
By default the the following protocols and ports are available for clients to connect to:
2303
2304
2305
2306
Update the code that creates the JMS connection:
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("ssl://amq-$USERID.rhcloud.com:2303");
Connection connection = factory.createConnection("admin", "$password");
Store the server's public self-signed certificate in a file called server.crt
. Then create a Java key store that imports the cert:
$ keytool -importcert -keystore my.jks -storepass password \
-file server.crt -noprompt
Configure the JVM to use the key store:
$ java -Djavax.net.ssl.trustStore=my.jks ...