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!
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