🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

How to set DMQ Eligible flag in Spring Boot

testup
testup Member Posts: 2

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

  • czajkowski
    czajkowski Member Posts: 3 ✭✭

    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 :)

  • testup
    testup Member Posts: 2

    As i understood, i have to use SolAdmin in Spring Boot. But is there any other ways?

  • RobO
    RobO Member, Employee Posts: 19 Solace Employee

    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;

    }