Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.55 KB

README.md

File metadata and controls

40 lines (27 loc) · 1.55 KB

This example was merged with the Apache Artemis project and won't receive more updates.

AMQ7 client with Spring JMS

This is a small sample of how to send and consume messages using Spring JMS, QPID and JMS Pool to a Red Hat AMQ7 broker. Use it as a reference for your own implementation.

Behind the scenes this sample uses amqp-10-jms-spring-boot library to set up the code infrastructure and configuration. Please take a look at its documentation to fine tune this sample for your needs.

Configuration

  1. Edit the src/main/resources/application.yml file and add your broker credentials to it.

  2. Create the queue at your broker.xml file:

<addresses>
  <address name="mailbox">
     <anycast>
         <queue name="mailbox">
             <durable>true</durable>
         </queue>
     </anycast>
   </address>
</addresses>
  1. Run the application with mvn spring-boot:run. The server should start at 8080 port and exposes /produce endpoint: http://localhost:8080/produce

  2. Hit it and a message should be sent to mailbox queue.

You may also use the hawtio console to send messages directly to the queue using the following format:

{
   "to":"test@test.com",
   "body":"this is my body"
}