Installing AMQ Broker Operator from OperatorHub

  1. Launch your web browser and open a new tab with the Administrator view of the web console for your Openshift cluster. Login to the console as an administrator.
  2. After login, click Operators->OperatorHub in the left side navigation menu. 
  3. On the Project drop-down menu at the top of the OperatorHub page, select the project in which you want to install in the Operator.
  4. There are quite a few different operators shown on the page. You can use the Filter by keyword box at the top of the page to quickly locate the AMQ Broker Operator. Just input text “Red Hat Integration - AMQ Broker Operator” and click on the result operator.
    Note you may find two operators in the filtered list. In that case, choose the operator whose name is exactly “Red Hat Integration - AMQ Broker Operator”. The other one is the Long Time Support (LTS) version of the AMQ Broker Operator.
    Red Hat Integration - AMQ Broker Operator
  5. Click Red Hat Integration - AMQ Broker Operator. In the dialog box that appears, click Install.

    AMQ Broker Operator configuration page

    It will bring you to the AMQ Broker Operator configuration page.

    AMQ broker operator supports

    Currently, the AMQ broker operator supports watching one specific namespace
  6. Click Install.

    When the Operator installation is complete, it will show you that the operator is ready to use.

    When the Operator installation is complete

  7. Click View Operator and you will get the installed AMQ Broker Operator details page.

Creating AMQ Broker Instances with the Operator

  1. At the operator details page, click Create new instance under the AMQ Broker box.

    Create new instance under the AMQ Broker box

  2. On the creation page, you can configure the broker. Fill in adminUser and adminPassword with values admin and admin. Then, under Deployment Plan, change the size value to 1. Finally, click the Create button at the bottom.
    If you don’t supply values for adminUserand adminPassword,they will be randomly generated. The Deployment Plan’s size default is 2.

    Fill in adminUser and adminPassword with values

  3. Then the console will show you the created Artemis instance with status. Click on the Name of the broker instance to see more details.

    Click on the Name of the broker instance to see more details

    The details page will look like this:

    AMQ Broker pod in Red Hat OpenShift

    It tells you that you have successfully created one AMQ Broker pod in Red Hat OpenShift.

Send and receive messages

Now you can test the broker pods by sending and receiving some messages.

  1. From the command line, login to the OpenShift cluster and change into your project where the operator is installed. Check the pod status:
    $ oc get pod
    
    amq-broker-operator-65545f7f6-xlrbx 1/1 Running  0   53m
    ex-aao-ss-0                         1/1 Running  0   44m
    
  2. Login to the broker pod ex-aao-ss-0.
    $ oc rsh ex-aao-ss-0
  3. Use the Artemis CLI to send some messages, e.g.
    $ amq-broker/bin/artemis producer --user admin --password admin --url tcp://ex-aao-ss-0:61616 --message-count
        100
    
    OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should
        configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
    Connection brokerURL = tcp://ex-aao-ss-0:61616
    Producer ActiveMQQueue[TEST], thread=0 Started to calculate elapsed time ...
    Producer ActiveMQQueue[TEST], thread=0 Produced: 100 messages
    Producer ActiveMQQueue[TEST], thread=0 Elapsed time in second : 1 s
    Producer ActiveMQQueue[TEST], thread=0 Elapsed time in milli second : 1796 milli seconds
    
  4. Consume the messages.
    $ amq-broker/bin/artemis consumer --user admin --password admin --url tcp://ex-aao-ss-0:61616 --message-count
        100
    
    OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should
        configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N
    Connection brokerURL = tcp://ex-aao-ss-0:61616
    Consumer:: filter = null
    Consumer ActiveMQQueue[TEST], thread=0 wait until 100 messages are consumed
    Consumer ActiveMQQueue[TEST], thread=0 Consumed: 100 messages
    Consumer ActiveMQQueue[TEST], thread=0 Elapsed time in second : 0 s
    Consumer ActiveMQQueue[TEST], thread=0 Elapsed time in milli second : 61 milli seconds
    Consumer ActiveMQQueue[TEST], thread=0 Consumed: 100 messages
    Consumer ActiveMQQueue[TEST], thread=0 Consumer thread finished

Congratulations! You just deployed the AMQ Broker Operator and deployed a broker to send and receive messages. 

For details and more information please refer to AMQ Broker online documentation:

https://access.redhat.com/documentation/en-us/red_hat_amq

Last updated: November 14, 2023