Try PubSub+

GARBAGE CHARACTER getting added in messages received in Request/Reply messaging method.

TestSolaceTestSolace Member Posts: 12

Hi Team,
I am using request and reply mechanism to send and receive messages. After I have sent the message, in the receiving Callback method i found that a garbage character is getting added at the end of the message. So on receiving the message, i am getting the garbage character,
Following is the way i am sending message:
std::string text_p = "ABCD";
solClient_uint32_t dataLen1 = ( solClient_uint32_t )strlen( (text_p.c_str()) );
solClient_opaqueMsg_pt replyMsg_p;
solClient_opaqueMsg_pt msg_p = NULL;
solClient_msg_alloc ( &msg_p ) ;
solClient_msg_setDestination ( msg_p, &destination, sizeof ( destination ))
solClient_msg_setBinaryAttachment ( msg_p, text_p.c_str(), (dataLen1));
solClient_session_sendRequest ( session_p, msg_p, &replyMsg_p, timeout);

I am using C Api.
Can anyone please tell me what is adding the garbage character and how to fix it.


Sign In or Register to comment.