Reprocessing Messages

Ali
Ali Member Posts: 3
edited September 2023 in General Discussions #1

I have a scenario similar to the one mentioned in this post

How can I get it to work in JCSMP with spring boot?

Tagged:

Answers

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 898 admin

    Hi @Ali ,

    If your consumer is using client acks you want to make sure you either ack or nack each message. This way if a message is nacked it can be redelivered, or sent to a dead message queue (if configured) and max-retries has been reached.

    See the Client Acknowledgements section of the docs here: https://docs.solace.com/API/API-Developer-Guide/Acknowledging-Messages.htm

    I believe you should be able to set this in your spring properties using:

    solace.java.apiProperties.message_ack_mode=JCSMPProperties.SUPPORTED_MESSAGE_ACK_CLIENT
    

    (You will probably have to look up the String value for that enum above...I don't recall)

    Hope that helps!

  • Ali
    Ali Member Posts: 3

    Hey @marc ,

    Thanks for the reply!

    I am using client ack mode and the "settle" methods to ack/nack. However, the message never gets redelivered.

    I tried breaking the flow by calling close() on the flowReceiver then creating a new flowReceiver, that also did not work. My best guess is that it is using the same session, but creating a new session for every redelivered message may cause performance issues.

    Any ideas about what could be happening?

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 898 admin

    Hi @Ali ,

    Can you check to make sure the queue is configured for redelivery. Also if you look at the stats it will show if the message is being discarded.