
- Apache ActiveMQ - Home
- Apache ActiveMQ - Overview
- Apache ActiveMQ - Environment Setup
- Apache ActiveMQ - Features
- Apache ActiveMQ - Running Broker Server
- Apache ActiveMQ - Admin Console
Apache ActiveMQ Queue Based Example
- Apache ActiveMQ - Producer Application
- Apache ActiveMQ - Consumer Application
- Apache ActiveMQ - Test Application
Apache ActiveMQ Topic Based Example
- Apache ActiveMQ - Publisher Application
- Apache ActiveMQ - Subscriber Application
- Apache ActiveMQ - Test Application
Apache ActiveMQ Useful Resources
Apache ActiveMQ - Test Topic Based Application
Start ActiveMQ Server
Now let's start the ActiveMQ Server. Go to the folder D:\apache-activemq-6.1.7\bin and type the following command.
Example
D:\apache-activemq-6.1.7\bin>activemq start
Output
You'll see the similar output and ActiveMQ will start running.
... INFO | Apache ActiveMQ 6.1.7 (localhost, ID:Home-55627-1754044777586-0:1) started INFO | For help or more information please see: http://activemq.apache.org INFO | ActiveMQ WebConsole available at http://127.0.0.1:8161/ INFO | ActiveMQ Jolokia REST API available at http://127.0.0.1:8161/api/jolokia/
Start the Publisher Application
In eclipse, right click on the Publisher.java source, and select Run As > Java Application. Publisher application will start running and you'll see the output as follows −
Enter message:
Start the Subscriber Application
In eclipse, right click on the Consumer.java source, and select Run As > Java Application. Subscriber application will start running and you'll see the output as follows −
Start another Subscriber Application
In eclipse, again right click on the Subscriber.java source, and select Run As > Java Application. Another Subscriber application will start running and you'll see the output as follows −
Send Message
In Publisher console window, type Hi and press enter button to send the message.
Enter message: Hi
Receive Message
Verify in Subscriber console windows, the message is received in each window.
Received = Hi
Send "Quit" as message to terminate both publisher and subscriber console window sessions.
Verification
Now open http://127.0.0.1:8161/admin/ in your browser. It will ask for credentials. Use admin/admin as username/password and it will load the ActiveMQ admin console where you can check Topics to check the status. It will show multiple messages enqueued and delivered.
