Hello All,
I Need your suggestion and help in below MQ process.
In coding when we are Putting the data we are calling MQPUT1(after MQCONN) without opening the MQ
but when we are getting data from MQ then we are opening the MQ...
so during MQPUT1, it already opens the MQ?? but do we need to Open MQ for getting the data from there??
Just add: during MQPUT1 we are giving the MQ name what we are using.
Thanks,
Dhiraj.
difference b/w MQ put and Get
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: difference b/w MQ put and Get
Hi Dhiraj,
The question in your subject line differs from what you've in the content of the thread.Are you really asking about the difference between MQPUT and MQGET calls or the difference between MQPUT and MQPUT1 calls?
I'll assume it's for the later part and if so, read on:
MQPUT1 is useful for putting a single message to a destination. And it is essentially equivalent to issuing MQOPEN, MQPUT, MQCLOSE. Since MQPUT1is a single MQI call it is more efficient. As such it is often used by server applications which need to send a single reply to requesting applications.
If you need to send more than one message then you are better off issuing the MQOPEN, MQPUT{*}, MQCLOSE sequence.
If you want to study further, you can see the difference here at MQPUT – Put message and MQPUT1 – Put one message. Which states:
The question in your subject line differs from what you've in the content of the thread.Are you really asking about the difference between MQPUT and MQGET calls or the difference between MQPUT and MQPUT1 calls?
I'll assume it's for the later part and if so, read on:
MQPUT1 is useful for putting a single message to a destination. And it is essentially equivalent to issuing MQOPEN, MQPUT, MQCLOSE. Since MQPUT1is a single MQI call it is more efficient. As such it is often used by server applications which need to send a single reply to requesting applications.
If you need to send more than one message then you are better off issuing the MQOPEN, MQPUT{*}, MQCLOSE sequence.
If you want to study further, you can see the difference here at MQPUT – Put message and MQPUT1 – Put one message. Which states:
MQPUT – Put message
The MQPUT call puts a message on a queue or distribution list, or to a topic. The queue, distribution list or topic must already be open
MQPUT1 – Put one message
The MQPUT1 call puts one message on a queue, or distribution list, or to a topic. The queue, distribution list, or topic does not need to be open
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: difference b/w MQ put and Get
Thanks Anuj for this information. yes I was not clear about heading of this question.
so for MQPUT1 we don't need to call MQOPEN but for MQGET we need to Open the MQ(MQOPEN)?
so for MQPUT1 we don't need to call MQOPEN but for MQGET we need to Open the MQ(MQOPEN)?
Dhiraj Mishra
- Anuj Dhawan
- Founder
- Posts: 2802
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: difference b/w MQ put and Get
MQPUT1 actually does an MQOPEN, MQPUT, and MQCLOSE, so you as a programmer don't type it. By definition, MQGET is the function which gets a message from a local queue that was opened for input by using the MQOPEN function - so yes you need to "open the queue".
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute