🎄 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.
XMLMessageProducer
Hello, does anyone knows how to use XMLMessageProducer with JCSMPStreamingPublishEventHandler?
I tested sample code according to example on this page: https://docs.solace.com/API-Developer-Online-Ref-Documentation/java/com/solacesystems/jcsmp/XMLMessageProducer.html.
Event responseReceived is returning message id different to sent message id. For example, sent message id has value 10 and received has 11 (almost greater by one). Is it expected behavior?
I am talking about version 10.6.3.
Thanks
Answers
-
Hey Pyp. I'd consider looking at the correlating publish handler: https://docs.solace.com/API-Developer-Online-Ref-Documentation/java/com/solacesystems/jcsmp/JCSMPStreamingPublishCorrelatingEventHandler.html. It's easier to use. You just need to set the correlation key on each message sent (could even be itself), and that way it's a lot easier to correlate, rather than using than using the MessageID.
But FYI, the order that messages are ACKed or NACKed are exactly the same as the order you publish, so you can also just keep your sent messages in a LinkedList until the ACK (responseReceived) or NACK (handleError) arrives.
1