Hello, does anyone knows how to use XMLMessageProducer with JCSMPStreamingPublishEventHandler?
I tested sample code according to example on this page: XMLMessageProducer (Solace Messaging API for Java v10.25.2).
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
Hey Pyp. I’d consider looking at the correlating publish handler: JCSMPStreamingPublishCorrelatingEventHandler (Solace Messaging API for Java v10.25.2). 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.