Dividing up work with queues (Simple)
In this recipe we look at how the JMS queue can be used to divide up work with a simple job queue example.
Getting ready
For this recipe we will use the two examples named job-producer
and job-consumer
that implement a simple job producer and consumer.
How to do it...
To run the sample for this recipe you will need to perform the following steps:
- Open a terminal and start a broker.
- Open a second terminal and change to the directory where
job-consumer
is located. Run the consumer by typingmvn compile exec:java
. (You can use Ctrl + C to terminate this app when done, it will stop on its own after five minutes.) - Open a third terminal and change to the directory where
job-producer
is located and run the producer by typing ...
Get Instant Apache ActiveMQ Messaging Application Development How-to now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.