문제

Is there a way to get the Correlation Id/ Message Id and store it into the variable? I want to put it into a variable and store it into the database.

I'm thinking of using MQMD.

MQMD *md;

std::string corid = md->CorrelId;

The code above is not functioning.

Please help me with this. BTW, I'm using Websphere MQ for C++.

Thanks! :)

도움이 되었습니까?

해결책

MessageID, CorrelID and GroupID are all byte arrays. Hence they can't be assigned the way you are trying to. Instead do the following to get messageID. You can try out similarly for CorrelationID and GroupID.

  if ( queue.get( msg, gmo ) ) 
  {
      // Get the message id 
      char byMessageId[24];
      ImqBinary msglId = msg.messageId();

      // Copy the message to a buffer.
      msglId.copyOut(byMessageId,24);
  } 

Hope this helped.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top