Regarding difference b/w Message Id and ApplicationMessageID
Hi,
When publishing message via C api, i need to manually set ApplicationMessageId inorder to see JMSMessageID value.
I was thinking this would be set automatically when publishing as when subscribing to queue i can see Message ID getting dispalyed?
What is the difference b/w these two and how can i set ApplicationMessageId to Message ID automatically?
Thanks
Amol
Comments
-
Hi @amol_p81 . The JMS header property "JMSMessageID" maps to "ApplicationMessageID" in the Solace C (CCSMP) API, as well as JCSMP and others. https://solace.com/blog/inside-a-solace-message-using-header-properties/
The Message ID is (sometimes) automatically set by the broker, depending on various things. Applications should not rely on them... consider it "internal use only". The can mean something when using Guaranteed (Persistent) publishing, and correlating acknowledgements. Generally, you can ignore the MessageID field. It will reset possibly during broke\r failovers and/or application restarts. (https://docs.solace.com/API-Developer-Online-Ref-Documentation/java/com/solacesystems/jcsmp/XMLMessage.html#getMessageId() JavaDocs with good explanation)
So, yes, there is no automatic way of setting the ApplicationMessageId in C or other APIs... the application must set it "manually".
1