Solace Community is getting a facelift!
On March 3rd we will be starting the process of migrating Solace Community to a new platform. As a result, Solace Community will go in to a temporary read-only state. You will still be able to come onto Solace Community and search through posts to find answers, but you won't be able to ask questions, post comments, or react in any way.
We hope to have the migration complete by Wednesday March 5th (or sooner), so please keep an eye out!
How to set DMQ Eligible flag in Spring Boot
Hi there,
i am using solace-jms-spring-boot-starter and jmstemplate in spring boot to send messages to queue. How can i set the DMQ Eligible flag over jmstemplate? Currently all my messages have the status DMQ Eligible NO.
public void sendEvent() throws Exception { String msg = "Hello World " + System.currentTimeMillis(); System.out.println("==========SENDING MESSAGE========== " + msg); jmsTemplate.setDeliveryMode(DeliveryMode.PERSISTENT); jmsTemplate.convertAndSend(queueName, msg); }
Answers
-
Hey there, thanks for posting and I hope we can help you. Please take a look at the following page and if you have any other questions please let us know. https://docs.solace.com/API/Solace-JMS-API/Setting-Message-Properties.htm#Dead Thanks :)
1 -
You should not have to use SolAdmin. Similar to what link was posted earlier, there is another link with available properties.
https://docs.solace.com/API/Solace-JMS-API/Message-Properties.htm
You can set all these properties via the JMS Template. The following is an example of how you could accomplish this.
jmsTemplate.convertAndSend(ORDER_QUEUE, order, m -> {
m.setJMSCorrelationID(UUID.randomUUID().toString());
m.setJMSExpiration(1000);
m.setBooleanProperty(SupportedProperty.SOLACE_JMS_PROP_ELIDING_ELIGIBLE, true);
return m;
}
0