Chapter 26. HowTo - Test Remote Messaging using Hermes JMS

26.1. Preparation

Those sections shows what have to be done initally.

26.1.1. Preparing the Server

Before starting the server you have to edit the file OPENENGSB_HOME/etc/system.properties You will find the lines:

# Uncomment to disable encryption for jms-messages
#org.openengsb.jms.noencrypt=true
        
# Uncomment to disable signature and timestamp verification for all remote requests
#org.openengsb.security.noverify=true

Uncomment (or if not existing add) the lines

org.openengsb.jms.noencrypt=true 
org.openengsb.security.noverify=true

This will enable you to send unencrypted messages to the server.

Now start the server and enter the following line:

features:install openengsb-ports-jms

This will open the JMS port of the OpenEngSb server, which is used to receive Json messages.

Installation Check

26.1.2. Setup Hermes

  • Download the latest Hermes version from www.hermesjms.com

  • Download ActiveMQ from activemq.apache.org

  • Unpack ActiveMQ

  • Install and Open Hermes (it is better to have the OpenEngSb server already running at this point)

  • Rightclick on the node “sessions” in the tree, go to New->New Session:

    Add Session

  • In the First Dropdown, enter "ActiveMQ"

    Enter Name for Session

  • Click on the Tab “Providers”

    Available Tabs

  • Rightclick in the center of the "Classpath Groups" panel. Select "Add Group" and enter "ActiveMQ".

  • Click on the new Group “ActiveMQ” and rightclick “Libary”, select “Add Jars”. Go to ActiveMQ_HOME/lib/ and select all contained jars. It should now look something like:

    List of AMQ libraries

  • IMPORTANT – An alert message is prompted, select “Scan”

    Checkbox during import of Libraries

  • Close the window with “Ok”.

  • Open the "sessions" folder in the tree and rightclick "ActiveMQ", select "edit":

    Edit a session

  • Select "ActiveMQ" in the "Loader" Dropdown (if you don't see the entry "ActiveMQ", then you probably did not select "Scan" in the Alertmessage above):

    Select the previously configured loader.

  • Select "org.apache.activemq.ActiveMQConnectionFactory" in the "Class" dropdown. Rightclick on properties and select "Add Property". Select "brokerURL" as the property-name and enter "tcp://localhost:6549" (this is the standard jms port of the OpenEngSb server, enter a different port if you have changed it in your distribution. The Entry should now look something like:

    The completely finished entry.

  • Select “Ok” to close and save.

  • Rightclick on the node “ActiveMQ” in the sessions folder and select New -> Add Queue:

    Add a queue in hermes.

  • Click on the “Name” entry and enter “receive”, press ENTER to save your input (Hermes JMS is a little buggy here). This the standard OpenEngSb-receive queue in this OpenEngSb-release. You must send all your Json messages to this queue.

  • Select “Ok” to close and save.

  • Now you have to open the queue on which the response of your message will come back. In this OpenEngSb-release, the response-queue has the same name as the "callId" of your message. Repeat the steps above and use the "callId" of your message instead of "receive".

  • Now you are ready to send and receive Json Messages to the OpenEngSb-Server.

26.2. Send and Receive Messages

  • Startup the OpenEngSb-Server before you Startup Hermes JMS (or else Hermes JMS might not recognise the server).

  • Expand the node "ActiveMQ" in the folder "sessions" and rightclick on the "receive" queue. Select New -> New Message

    Create a new Message in Hermes.

  • Switch to the "Payload" tab and paste your message into the textfield.

    Configure a message for the OpenEngSB.

  • Press "Send" to send your message, there is no further response or notification that the message was sent. Press "Done" to close the window.

  • Now Doubleclick on the queue with your "callId", you should see your responses:

    Retrieve a message response.

  • If you do not see a respone, then enter "display" in the console of your OpenEngSb server to view the last logmessages. It is likely that you will see some Error-messages, concerning your Jsonmessage, there.

Have fun testing with Json. :-)