...
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:
...
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.
- Open a command prompt and navigate to the
<JMS_CLIENTS_HOME>
directory on your computer. Execute the following command, which will publish 10 messages to the queue named 'testQueue':
Code Block ant queuePublisher
- Go to the management console.
- In the Main tab, click Queues -> List. You can see that 10 messages have been published to the queue as shown below.
- 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.
- Open a command a command prompt and navigate to the location of your JMS clientsthe
<JMS_CLIENTS_HOME>
directory on your computer. 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
- The 10 messages in the queue have been successfully consumed by the subscriber. You can verify this from the terminal log:
- 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.
are no longer there.