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: 17 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;

    }