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 » IBM MQ API Support » MQPUT and MQPUT1 difference

Post new topic  Reply to topic Goto page 1, 2  Next
 MQPUT and MQPUT1 difference « View previous topic :: View next topic » 
Author Message
srikanthc60
PostPosted: Fri Jul 26, 2013 9:21 am    Post subject: MQPUT and MQPUT1 difference Reply with quote

Voyager

Joined: 21 Jul 2013
Posts: 79

what is the difference between MQPUT and MQPUT1 calls?
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Jul 26, 2013 10:01 am    Post subject: Re: MQPUT and MQPUT1 difference Reply with quote

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
View user's profile Send private message
PaulClarke
PostPosted: Sat Jul 27, 2013 3:12 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Sat Jul 27, 2013 4:54 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9396
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
View user's profile Send private message
PaulClarke
PostPosted: Sat Jul 27, 2013 5:04 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
bruce2359
PostPosted: Sat Jul 27, 2013 9:52 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9396
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
View user's profile Send private message
PaulClarke
PostPosted: Sat Jul 27, 2013 11:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mqjeff
PostPosted: Sun Jul 28, 2013 5:27 am    Post subject: Reply with quote

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
View user's profile Send private message
rcp_mq
PostPosted: Mon Jul 29, 2013 9:00 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Mon Jul 29, 2013 9:18 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9396
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
View user's profile Send private message
rcp_mq
PostPosted: Mon Jul 29, 2013 10:54 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Mon Jul 29, 2013 11:00 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9396
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
View user's profile Send private message
rcp_mq
PostPosted: Mon Jul 29, 2013 11:26 am    Post subject: Reply with quote

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
View user's profile Send private message
bruce2359
PostPosted: Mon Jul 29, 2013 12:16 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9396
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
View user's profile Send private message
Vitor
PostPosted: Mon Jul 29, 2013 1:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » MQPUT and MQPUT1 difference
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.