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 » Question on accessing queues through programs:

Post new topic  Reply to topic
 Question on accessing queues through programs: « View previous topic :: View next topic » 
Author Message
anveshita
PostPosted: Thu Feb 16, 2006 7:39 pm    Post subject: Question on accessing queues through programs: Reply with quote

Master

Joined: 27 Sep 2004
Posts: 254
Location: Jambudweepam

I have a queue manager QM1 which has queues Q1 Q2 and Q3. I am planning to have two progams PGM1 and PGM2. PGM1 would run continuously and checks Q1 for messages. If a message comes to Q1, pgm1 will GET it , processes it and PUTs the modified content into Q3. Likewise PGM2 monitors Q2 and transfers messages from Q2 to Q3. Now my question: Will there be any clash for resource Q3 as both programs PGM1 and PGM2 would try to put messages at the same time. My question is if PGM1 opens a connection for putting the message, will the program PGM2 be able to open the connection for putting the message at the same time? If that is going to be an issue, how can achieve my goal of transferring messages.
Thanks
Back to top
View user's profile Send private message
csmith28
PostPosted: Thu Feb 16, 2006 8:24 pm    Post subject: Reply with quote

Grand Master

Joined: 15 Jul 2003
Posts: 1196
Location: Arizona

No, there shouldn't be as long as you leave the Queue Shared.

That is to day the attribute of the Qlocal is SHARE as apposed to NOSHARE.
_________________
Yes, I am an agent of Satan but my duties are largely ceremonial.
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri Feb 17, 2006 2:33 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

csmith28 wrote:
No, there shouldn't be as long as you leave the Queue Shared.

That is to day the attribute of the Qlocal is SHARE as apposed to NOSHARE.
but I think the question related to putting messages to Q3 by two programs at the same time.

SHARE/NOSHARE controls the getting of messages from a queue, not the putting. Actually, there is nothing in MQ to prevent more than one application from putting messages to a queue at the sametime. Its a common practice, so your solution should work.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
anveshita
PostPosted: Thu Feb 23, 2006 12:55 pm    Post subject: Reply with quote

Master

Joined: 27 Sep 2004
Posts: 254
Location: Jambudweepam

Thanks for clarifying my doubts regarding put
This is like a follow up question.

Quote:
PGM1 would run continuously and checks Q1 for messages.
If a message comes to Q1, pgm1 will GET it , processes it and PUTs the
modified content into Q3.


Now if i need my PGM1 just to change the content of the message and put
the message into Q3.
Based on a flag I need to modiy the message header information like correlation ID etc.,
If the flag is set to TRUE I have to use the same header information that came with incoming message.
If the flag is set to FALSE I have to change the heade information.

My question is: how can retain the header information unchanged?
Please let me know what steps I need to take
Back to top
View user's profile Send private message
vennela
PostPosted: Thu Feb 23, 2006 1:02 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Quote:
My question is: how can retain the header information unchanged?

What makes you think it will be changed
Back to top
View user's profile Send private message Send e-mail Visit poster's website
wschutz
PostPosted: Thu Feb 23, 2006 1:06 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Quote:
My question is: how can retain the header information unchanged?
Use the same message descriptor structure (MQMD) that you used to issue the MQGET for executing the MQPUT.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
bergc
PostPosted: Thu Feb 23, 2006 3:06 pm    Post subject: Reply with quote

Newbie

Joined: 01 Feb 2006
Posts: 3
Location: TEXAS

Wayne,

What does DEFSOPT(EXCL/SHARED) do differently than the SHARE/NOSHARD attribute?

Thanks.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Feb 23, 2006 3:40 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

If my memory serves me well it is the default share mode option on open.
If you open a shared queue in exclusive mode nobody else can retrieve messages...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
wschutz
PostPosted: Thu Feb 23, 2006 4:22 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

bergc wrote:
Wayne,

What does DEFSOPT(EXCL/SHARED) do differently than the SHARE/NOSHARD attribute?

Thanks.
The attributes that begin with "DEF" mean "default" (DEFBIND: default binding for clustering, DEFPRTY: default message priority, DEFPSIST: default persistence, DEFSOPT: default share option, DEFTYPE: ooopss... DEFINITION TYPE). These values are used if the application doesn't specify them on the MQOPEN or MQPUT.

So thats the value used if your application doesn't specify a value on the MQOPEN (or specifys MQOO_INPUT_AS_Q_DEF). SHARED/NOSHARE says absolutely whether or not the queue can be shared. So if its set to NOSHARE and either DEFSOPT(SHARED) was set or the application specified MQOO_INPUT_SHARED, it still can't be shared.

So, to net it out ...in order for two allplications to have a queue open for input at the same time, SHARE must be specified and both applications must specify MQOO_INPUT_SHARED, or it must be defaulted.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
skn
PostPosted: Fri Feb 24, 2006 7:41 am    Post subject: Reply with quote

Centurion

Joined: 21 May 2003
Posts: 112
Location: Dallas

Thanks for the clarification.
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 » Question on accessing queues through programs:
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.