Author |
Message
|
anveshita |
Posted: Thu Feb 16, 2006 7:39 pm Post subject: Question on accessing queues through programs: |
|
|
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 |
|
 |
csmith28 |
Posted: Thu Feb 16, 2006 8:24 pm Post subject: |
|
|
 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 |
|
 |
wschutz |
Posted: Fri Feb 17, 2006 2:33 am Post subject: |
|
|
 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 |
|
 |
anveshita |
Posted: Thu Feb 23, 2006 12:55 pm Post subject: |
|
|
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 |
|
 |
vennela |
Posted: Thu Feb 23, 2006 1:02 pm Post subject: |
|
|
 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 |
|
 |
wschutz |
Posted: Thu Feb 23, 2006 1:06 pm Post subject: |
|
|
 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 |
|
 |
bergc |
Posted: Thu Feb 23, 2006 3:06 pm Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Thu Feb 23, 2006 3:40 pm Post subject: |
|
|
 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 |
|
 |
wschutz |
Posted: Thu Feb 23, 2006 4:22 pm Post subject: |
|
|
 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 |
|
 |
skn |
Posted: Fri Feb 24, 2006 7:41 am Post subject: |
|
|
 Centurion
Joined: 21 May 2003 Posts: 112 Location: Dallas
|
Thanks for the clarification. |
|
Back to top |
|
 |
|