🎄 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 setting JMSMessageID with solclient C api

amol_p81
amol_p81 Member Posts: 22

Hi,

Is it possible to call / set JMSMessageId with the help of solclient C api?
Or can i intgerate JMS api in C code to set JMS realted headers when sending message (via solclient C api)?

Need help on this urgently.

Regards
Amol

Tagged:

Best Answer

Answers

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    Hi @amol_p81,
    You sure can! The JMSMessageID header field on a JMS Message maps to the ApplicationMessageID field in the Solace APIs so in the C API you would just get/set the ApplicationMessageID header

    You can also see how other header fields map in a table in the docs here: https://docs.solace.com/Solace-JMS-API/Message-Components.htm#Header

    Hope that helps :)

  • amol_p81
    amol_p81 Member Posts: 22

    Yes, i have tried setting the ApplicationMessageID to 1 (string type), however the consumer seems not showing JMSMessageID.
    Also the format of JMSMessageID looks different "ID:fe*:00:000:00".
    Or is there any way calling JMS related functions in C++/C code.

  • amol_p81
    amol_p81 Member Posts: 22
    edited May 2020 #6

    Thanks for the update Marc.
    Will share C code.
    Since i'm on Redhat, can you please update on how to use sdkperf C for Linux 2.6 x64.
    Or is it in similar terms to solclient C api?

  • amol_p81
    amol_p81 Member Posts: 22
    edited May 2020 #7

    Marc,
    Had a query, when i run the soclient C api example in Intro folder HelloWorldQueuePub process, i dont see any error and able to see Acknowledgement received.
    However when executing the sdkperf_java.sh (sdkperf_java.sh -cip localhost:55555 -cu username@vpn -cp password -stl topic -q -md, modifying the parameters accordingly as used for HelloWorldQueuePub), i see ****Error response (403) - Subscription ACL Denied - Topic '........', subscription additions failed.
    Error response (400) - Subscription Not Found - Topic ****
    Topic used is same as one for HelloWorldQueuePub.
    sdkperf version is 7.1.2.33.
    solclient version - 7.3.0.3.

    Please let me know if there is any issue with topic as when executing HelloWorld processes i dont get any errors.

  • amol_p81
    amol_p81 Member Posts: 22

    Need a quick help over here, using solclient C api, the message has the following properties
    SolTextMessage={ JMSDeliveryMode:1,JMSDestination:Topic 't.rfds.ds.notify.int5',JMSExpiration:0,JMSMessageID:2,JMSPriority:0,JMSRedelivered,JMSTimestamp:0,JMSProperties:{JMS_Solace_isXML:true,JMS_Solace_DeliverToOne:false,JMS_Solace_DeadMsgQueueEligible:false,JMS_Solace_ElidingEligible:false,Solace_JMS_Prop_IS_Reply_Message:false},SolPayload:{XML:len=295} }
    However the JMSProperties is seen as NULL.

    The format required is
    SolTextMessage={ JMSDeliveryMode:2,JMSDestination:Topic 't.rfds.ds.notify.int5',JMSExpiration:1588958554273,JMSMessageID:ID:fe80:0:0:0:250:56ff:fea2:2a21%eth0dff5171eb010b570:4,JMSPriority:0,JMSRedelivered,JMSTimestamp:1588785753229,JMSProperties:
    {cobdate:04-MAY-2020,snapshotid:41,valuationcontextid:1b_VAR-1d,statusremarks:,brds_dsloadid:1,rowcount:331,confidence_level:.99,dsloadid:103103087,scenario_context:VaR,package_type:FINAL,horizon:1d,measure_type:VaR,feedid:65,timetaken:6431,ds_wf_status:COMPLETED,datasource:RFDS,dsname:PA HISTSIM HYBRID VAR,runtype:HISTSIM_VAR_RFG,notificationtype:DATASET,grainids:
    [11b54131428443c9899974420d113cf5],taskid:164,snaptype:VaR_1d_FINAL,JMS_Solace_isXML:true,JMS_Solace_DeliverToOne:false,JMS_Solace_DeadMsgQueueEligible:false,JMS_Solace_ElidingEligible:false,Solace_JMS_Prop_IS_Reply_Message:false}
    ,SolPayload:{XML:len=438} }
    How can i see above with solclient C api?

  • amol_p81
    amol_p81 Member Posts: 22

    Giving more details (with C api)
    Message was sent in xml format (text format), however they are extracting properties with getProperties, however they are not getting anything.

  • amol_p81
    amol_p81 Member Posts: 22

    Marc,
    WIll you be able to check on JMSProperties question and update?
    Do i need to use solClient_msg_createUserPropertyMap to set the format of message as xml, so that at the consumer end getProperties work?

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 963 admin

    @amol_p81 - I went ahead and answered on the other thread. Hope that helps!

  • amol_p81
    amol_p81 Member Posts: 22

    Marc,
    Need the correct function (set function) for setting message type to Text?
    Have tried with solClient_msg_setXml , solClient_msg_setBinaryAttachment and solClient_msg_setBinaryAttachmentString but these functions looks incorrect (for sending textMessage)