In my Spring Boot application I have configured Embedded Apache ActiveMQ.
@Configuration
@EnableJms
public class ActiveMQConfig {
@Bean
public Queue queue() {
return new ActiveMQQueue("import.decisions.queue");
}
}
In order to send the messages I use the following code:
@Autowired
private JmsMessagingTemplate jmsMessagingTemplate;
@Autowired
private Queue queue;
this.jmsMessagingTemplate.convertAndSend(this.queue, message);
Right now I use in-memory ActiveMQ, this is my application.properties
:
#ActiveMQ
spring.activemq.in-memory=true
spring.activemq.pool.enabled=false
spring.activemq.packages.trust-all=true
Because I don't want to lose the messages that was already enqueued, for example during the application restarts I need to configure my Embedded ActiveMQ to persist the data.
Could you please show how it can be done with Spring Boot configuration ?