Versions Compared

Key

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

...

  1. Start the server and Launch the administrative console.
  2. Under Services. Select JMS Resources.





  3. Under Create a new JMS Resource Group:. Select For ActiveMQ.





  4. On the next screen suggest a Resource Group Name. In our case we are using WebJMS. All other values can be taken as default.





  5. Select Next once done.





  6. Select Add Connection Factory on the next page.





  7. In the drop down box select javax.jms.QueueConnectionFactory. Select Next.





  8. Next give the Connection Factory Name as jms/TestConnectionFactory. Keep default for all other fields. Select Next.





  9. Select Add Destination on the next screen.





  10. Select JMS Destination Type as javax.jms.Queue. Select Next.





  11. Name the Message Destination Name as jms/TestQueue. Select Next.





  12. On the next screen Select Deploy Now. This will deploy the created Plan.





  13. Under JMS resources you can see the newly created connection factory and queue.





Adding producer and consumer code to the application

  1. Right click on WebJMS project and create a new servlet.


    Image Added


  2. Name the servlet as UserServlet and package as webjms. This is the producer in the application.


    Image Added


  3. Select Next and later Finish.


    Image Added


  4. Similarly create a second servlet AdminServlet. This is the consumer in the application.


    Image Added


    Image Added


  5. Right Click on WebContent and create a jsp.


    Image Added


  6. Name the jsp as index.jsp. Select Next.


    Image Added


  7. Select Finish.


    Image Added


    This will create the skeleton for the servlet and jsp required by the application.