🎄 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.

Regarding getting messageID via solClient_msg_getApplicationMessageId

amol_p81
amol_p81 Member Posts: 22
edited February 2022 in PubSub+ Event Broker #1

Hi,

Is it possible to get the ApplicationMessageId when publishing the message via fun call solClient_msg_getApplicationMessageId?
When publishing i'm trying to get messageId just after fn call solclient_msg_alloc() but i get NULL MessageID.
Any pointers how to use it?

Regards
Amol

Tagged:

Comments

  • TomF
    TomF Member, Employee Posts: 412 Solace Employee

    Hi @amol_p81, I'm not sure what you're trying to do here. The idea of ApplicationMessageId is that it's for use by your application - so you'd set it as a publisher and the subscriber would query it.

    For the publisher:
    solclient_msg_alloc();
    solClient_msg_setDeliveryMode()
    solClient_msg_setBinaryAttachment() // For example
    solClient_msg_setApplicationMessageId()

    It will definitely not be set just after you allocate the buffer as the buffer will be unassigned.

    Are you trying to get the messageId? If so, I'd very much recommend against it. This is an internal API message ID not intended for use by users - it is reset during failover, for instance. The recommendation in this scenario is for you to assign the messageID/sequence number etc yourself, using.... setApplicationMessageId().

  • amol_p81
    amol_p81 Member Posts: 22

    thanks Tom for the update.