THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Start the server and Launch the administrative console.
- Under Services. Select JMS Resources.
- Under Create a new JMS Resource Group:. Select For ActiveMQ.
- On the next screen suggest a Resource Group Name. In our case we are using WebJMS. All other values can be taken as default.
- Select Next once done.
- Select Add Connection Factory on the next page.
- In the drop down box select javax.jms.QueueConnectionFactory. Select Next.
- Next give the Connection Factory Name as jms/TestConnectionFactory. Keep default for all other fields. Select Next.
- Select Add Destination on the next screen.
- Select JMS Destination Type as javax.jms.Queue. Select Next.
- Name the Message Destination Name as jms/TestQueue. Select Next.
- On the next screen Select Deploy Now. This will deploy the created Plan.
- Under JMS resources you can see the newly created connection factory and queue.
Adding producer and consumer code to the application
- Right click on WebJMS project and create a new servlet.
- Name the servlet as UserServlet and package as webjms. This is the producer in the application.
- Select Next and later Finish.
- Similarly create a second servlet AdminServlet. This is the consumer in the application.
- Right Click on WebContent and create a jsp.
- Name the jsp as index.jsp. Select Next.
- Select Finish.
This will create the skeleton for the servlet and jsp required by the application.