Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We will use sample JMS clients in this quick start guide to see simulate how messages can be are published to WSO2 MB and how the published messages can be are consumed. First, you need to download and set up these clients as follows:

...

Let's try out a simple scenario of brokering messages using a queue in WSO2 MB.

Step 1: Create a queue in WSO2 MB

...

  1. Log in to the management console using the credentials of the default system administrator: admin/admin.
    You will now be logging into the super tenant domain. 
  2. In the Main tab, click Queues -> Add. The Add Queue screen will open.
  3. Enter 'testQueue' as the name in the Queue Name field as shown below.
    Image RemovedImage Added
  4. Click Add Queue and the new queue will be listed in the Queue List page as shown below.
    Image RemovedImage Added
    You can access the Queue List page by clicking Queues -> List in the Main tab of the navigator.

Step 2: Publish messages to the queue

You can now use the queue publisher sample JMS Queue Publisher client to publish messages to this queue. Follow the steps given below.

  1. Open a command prompt and navigate to the <JMS_CLIENTS_HOME> directory on your computer.
  2. Execute the following command, which will publish 10 messages to the queue named 'testQueue':

    Code Block
    ant queuePublisher
  3. Go to the management console.
  4. In the Main tab, click Queues -> List. You can see that 10 messages have been published to the queue as shown below.
    Image RemovedImage Added
  5. Click Browse to see details of the messages received.

Step 3: Subscribe to the queue and consume messages

The queue subscriber Now, you need a JMS client to subscribe to the 'testQueue' queue and consume the messages. The sample JMS Queue Subscriber JMS client will be used for this purpose. Follow the steps given below.

  1. Open a command a command prompt and navigate to the location of your JMS clientsthe <JMS_CLIENTS_HOME> directory on your computer.
  2. Execute the following command, which will subscribe to create a subscription to the queue and consume the available messages'testQueue' queue.

    Code Block
    ant queueSubscriber
  3. The 10 messages in the queue have been successfully consumed by the subscriber. You can verify this from the terminal log:
    Image Added
  4. Go to the management console . In the Main tab, and click Queues -> ListList in the Main tab. You can see that the 10 messages that were stored in the queue have been successfully consumed by the subscriber.You can verify this from the terminal log.
    Image Removedare no longer there.