Topic navigation

Blog Articles

Calling A-MQ Deployed in OpenShift by an External Client

As I tried to create queues/topics installed within OpenShift 3.2 and accessible to external clients, I found that there were more things assumed about the process than not. So I decided to share my steps with others.

The only supported template for this scenario is via ssl transport with persistence

Big Assumptions:

That OpenShift is installed and working

Persistent volumes have been created in OpenShift to use

You must have a persistent store (i.e. a PV must be set up) based upon the template we are using.

The volume claim is made during the build. It must be smaller than the size of the PV

Add the view role to the service account. This enables the service account to view all the resources in the amq-demo namespace, which is necessary for managing the cluster when using the Kubernetes REST API agent for discovering the mesh endpoints.

Now we must create a route that will expose this service to the outside world. Click on create route next to <applicationName>-amq-tcp-ssl Service.

This will start the create route dialog. Give the route a name and then select show options for secure routes.

Select passthrough for the TLS Termination. From documentation: With passthrough termination, encrypted traffic is sent straight to the destination without the router providing TLS termination. Therefore no key or certificate is required.

Hit create.

You should then see a route above the service as in below:

Now that the broker is ready to go in OpenShift, you can access it externally by some client. My example, will demonstrate Camel connectivity.

In Camel you want to setup a route that includes the ActiveMQ component. The configuration for accessing A-MQ broker in OpenShift should look similar to below:

In the Pods detail window you can start the activemq console by selecting Open Java Console

Here you will find statistics about the broker.

Now scale up to 2 or 3 pods. You will find that when you start the camel route again, it will go to the newly created pod (#2). Now kill that pod, oc delete pod <podName>. You will see in the eclipse console: