A message broker is middleware that relays messages between application components. Producers send messages to queues or topics; consumers receive them asynchronously, creating looser coupling and supporting scalability. section 9.1 section 9.4
In Java applications, JMS provides a common API for working with different brokers. Spring builds on it with JmsTemplate for sending and receiving messages and message-driven POJOs for reacting to arrivals. section 9.1 section 9.1
A Spring application can interact with a broker through:
- JmsTemplate, RabbitTemplate, or KafkaTemplate for template-based message sending and pull-based receiving. section 9.4
- Message listener annotations such as @JmsListener, @RabbitListener, or @KafkaListener for pushed delivery to consumer methods. section 9.4
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-artemis</artifactId> </dependency>
Add the Spring Boot Artemis starter to a project before connecting JMS code to an Artemis broker. section 9.1.1
Artemis is the recommended choice here over legacy ActiveMQ, although application code changes little between them. Development uses localhost:61616 by default; production configuration supplies the broker host, port, and optional credentials. section 9.1.1 section 9.1.1


