|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Correlation ID as header while pushing the message to MQ |
« View previous topic :: View next topic » |
Author |
Message
|
pras120687 |
Posted: Thu Jan 06, 2022 5:16 am Post subject: Correlation ID as header while pushing the message to MQ |
|
|
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 |
|
 |
bruce2359 |
Posted: Thu Jan 06, 2022 5:27 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
pras120687 |
Posted: Thu Jan 06, 2022 5:30 am Post subject: |
|
|
Newbie
Joined: 06 Jan 2022 Posts: 6
|
I am new to this MQ. could you please add few lines of code |
|
Back to top |
|
 |
pras120687 |
Posted: Thu Jan 06, 2022 6:22 am Post subject: |
|
|
Newbie
Joined: 06 Jan 2022 Posts: 6
|
Please can anyone help with the code ? |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Jan 06, 2022 7:12 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
pras120687 |
Posted: Thu Jan 06, 2022 7:24 am Post subject: |
|
|
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 |
|
 |
bruce2359 |
Posted: Thu Jan 06, 2022 7:30 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
bruce2359 |
Posted: Thu Jan 06, 2022 7:50 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|