ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Correlation ID as header while pushing the message to MQ

Post new topic  Reply to topic
 Correlation ID as header while pushing the message to MQ « View previous topic :: View next topic » 
Author Message
pras120687
PostPosted: Thu Jan 06, 2022 5:16 am    Post subject: Correlation ID as header while pushing the message to MQ Reply with quote

Newbie

Joined: 06 Jan 2022
Posts: 6

Hi All,

Can anybody suggest the code to pass correlation ID as header to the message that we push to MQ.

I have code to push the message to MQ but not sure how to add correlation ID as a header to the message before pushing.

Please let me know ASAP.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jan 06, 2022 5:27 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9405
Location: US: west coast, almost. Otherwise, enroute.

In the Request-Reply app design model, the CorrelId field of the Message Descriptor header (MQMD) is 24 bytes, and typically used to correlate a Reply message to the Request message. It is set == to the MessageId of the Request message.

Does this help?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
pras120687
PostPosted: Thu Jan 06, 2022 5:30 am    Post subject: Reply with quote

Newbie

Joined: 06 Jan 2022
Posts: 6

I am new to this MQ. could you please add few lines of code
Back to top
View user's profile Send private message
pras120687
PostPosted: Thu Jan 06, 2022 6:22 am    Post subject: Reply with quote

Newbie

Joined: 06 Jan 2022
Posts: 6

Please can anyone help with the code ?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jan 06, 2022 7:12 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9405
Location: US: west coast, almost. Otherwise, enroute.

What programming language would you prefer? In your favorite language, how do you set a variable to a value?

COBOL: MOVE INBOUND-MESSAGEID TO OUTBOUND-CORRELID.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
pras120687
PostPosted: Thu Jan 06, 2022 7:24 am    Post subject: Reply with quote

Newbie

Joined: 06 Jan 2022
Posts: 6

I am using java below is the code which i tried after your suggestions above

Code:
String m_corr = "PrasanthCorruPrash";

                     MQMD md = new MQMD();

                     md.setCorrelId(m_corr.getBytes());


Is this correct?
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jan 06, 2022 7:30 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9405
Location: US: west coast, almost. Otherwise, enroute.

Did you try it? What were the results?

Search google for ‘mq CorrelId Java examples’?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu Jan 06, 2022 7:50 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9405
Location: US: west coast, almost. Otherwise, enroute.

May I suggest that you get some training in MQ fundamentals, especially terminology. Header in MQ means one of the many IBM-supplied structures, such as MQMD (Message Descriptor), MQOD (Object Descriptor), MQPMO (Put Message Options), and so on.

CorrelId is a field in the MQMD.

'Push' is not an MQ term. Messages are MQPUT to queues, MQGET from queues. Many development language environments are supported, included MQ Classes for Java, JMS.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Correlation ID as header while pushing the message to MQ
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.