Author |
Message
|
srikanthc60 |
Posted: Fri Jul 26, 2013 9:21 am Post subject: MQPUT and MQPUT1 difference |
|
|
Voyager
Joined: 21 Jul 2013 Posts: 79
|
what is the difference between MQPUT and MQPUT1 calls? |
|
Back to top |
|
 |
Vitor |
Posted: Fri Jul 26, 2013 10:01 am Post subject: Re: MQPUT and MQPUT1 difference |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
srikanthc60 wrote: |
what is the difference between MQPUT and MQPUT1 calls? |
It's the difference described here and here. Observe:
Quote: |
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
|
See how they have different descriptions? That's the difference. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PaulClarke |
Posted: Sat Jul 27, 2013 3:12 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
MQPUT1 is useful for putting a single message to a destination and is essentially equivalent to issuing MQOPEN, MQPUT, MQCLOSE. However, since MQPUT1is a single MQI call it is naturally more efficient. As such it is often used by server applications who 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.
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Jul 27, 2013 4:54 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
PaulClarke wrote: |
...since MQPUT1is a single MQI call it is naturally more efficient. ... |
More efficient for hardware? For software? For the programmer? _________________ 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 |
|
 |
PaulClarke |
Posted: Sat Jul 27, 2013 5:04 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Well, I suppose ultimately for all three. But I was essentially thinking of CPU cost and latency. There is an inherent cost associated with each MQI call, especially over a client connection which includes a TCP/IP round-trip. Even locally there is a considerable cost in marshalling the API calls and transferring the request to the Queue Manager. If you can achieve the same effect with one call than you could with three then clearly that would be your best option.
Hope this helps,
P. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
bruce2359 |
Posted: Sat Jul 27, 2013 9:52 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
PaulClarke wrote: |
Hope this helps,
P. |
As with most things, there is a trade-off.
On more than a few client engagements for performance problems and tuning, I've found misused MQPUT1 calls.
Misused in the sense that the original application design specification called for only a few messages per minute, only to expand later on to hundreds or thousands per minute. _________________ 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 |
|
 |
PaulClarke |
Posted: Sat Jul 27, 2013 11:46 pm Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
You are quite right that as the needs of the application change then the pendulum may swing to an alternative choice between MQPUT and MQPUT1. Like every other aspect of an application ( or indeed the middleware itself ) as the requirements change so too should the design and implementation.
Of course it is much easier to say than do  _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Jul 28, 2013 5:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
PaulClarke wrote: |
Of course it is much easier to say than do  |
Particularly when people believe "If it ain't broke, don't fix it".
If the requirements change, it's now broken. Fix it. |
|
Back to top |
|
 |
rcp_mq |
Posted: Mon Jul 29, 2013 9:00 am Post subject: |
|
|
 Centurion
Joined: 13 Dec 2011 Posts: 133
|
Quote: |
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 |
...MQPUT1 call assumes that the queue/topic is already open. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Jul 29, 2013 9:18 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
rcp_mq wrote: |
...MQPUT1 call assumes that the queue/topic is already open. |
No. The MQPUT1 call makes no assumptions. It MQOPENs the queue/topic, puts a single message, and closes the queue/topic. _________________ 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 |
|
 |
rcp_mq |
Posted: Mon Jul 29, 2013 10:54 am Post subject: |
|
|
 Centurion
Joined: 13 Dec 2011 Posts: 133
|
(swaying from the topic)
...MQPUT1 call 'assumes' that the queue/topic is already open...that is why it does not put a MQOO_OUTPUT call. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Jul 29, 2013 11:00 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
rcp_mq wrote: |
(swaying from the topic)
...MQPUT1 call 'assumes' that the queue/topic is already open...that is why it does not put a MQOO_OUTPUT call. |
Again, no assumption is made; and the call must include a valid and complete mqod.
I strongly recommend that you research the mqput1 call in the official IBM documentation. _________________ 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 |
|
 |
rcp_mq |
Posted: Mon Jul 29, 2013 11:26 am Post subject: |
|
|
 Centurion
Joined: 13 Dec 2011 Posts: 133
|
(on the verge of trolling)
This space is too small to put a complete explanation, besides IBM documentation is too basic for research.
Experience and self experimentation yield more thorough answers. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Jul 29, 2013 12:16 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
rcp_mq wrote: |
(on the verge of trolling)
This space is too small to put a complete explanation, besides IBM documentation is too basic for research.
Experience and self experimentation yield more thorough answers. |
You are wrong on this, and on mqput1. _________________ 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 |
|
 |
Vitor |
Posted: Mon Jul 29, 2013 1:30 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
rcp_mq wrote: |
...MQPUT1 call 'assumes' that the queue/topic is already open... |
No it doesn't
rcp_mq wrote: |
that is why it does not put a MQOO_OUTPUT call. |
It does do an open inside the call, followed by a close. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|