Try PubSub+
If you haven't already, check out our new Developer Portal! You'll find useful information about Solace PubSub+ as well as handy resources to get you started.

Regarding getting messageID via solClient_msg_getApplicationMessageId

amol_p81amol_p81 Member Posts: 20

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

Comments

  • TomFTomF Member, Employee Posts: 62 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_p81amol_p81 Member Posts: 20

    thanks Tom for the update.

Sign In or Register to comment.