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 » MQOPEN() simultaneously for 2 Queues

Post new topic  Reply to topic
 MQOPEN() simultaneously for 2 Queues « View previous topic :: View next topic » 
Author Message
nik_iway
PostPosted: Tue Jul 18, 2006 8:49 pm    Post subject: MQOPEN() simultaneously for 2 Queues Reply with quote

Centurion

Joined: 21 Jul 2005
Posts: 115

Hi Everybody,

I am connection to Queue Manager and getting the Queuemanager Connection handle for Connecting to the Queue. I have 2 local Queues. Can it be possible to open the 2 local queues at the same time.
In the Present application i have 2 queues QUEUEA and QUEUEB, i declared them in the array .

While(true)
{
for (int i = o; i < Queueno.length; i++)
in the MQOPEN i am Passing the Queuearray[i]
Wait Unlimited Option Specified in get Message Options
MQGET
}

First its going and picking the message from QUEUEA and then QUEUEB and Again back to QUEUEA then QUEUEB.

I want to simultaneously get the messages from the QUEUEA and QUEUEB using the same QueueManager Connection Handle.....

Wat could be the best possible option....
Thanking you and Regards
Nik
Back to top
View user's profile Send private message
mvic
PostPosted: Wed Jul 19, 2006 2:03 am    Post subject: Re: MQOPEN() simultaneously for 2 Queues Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

nik_iway wrote:
I want to simultaneously get the messages from the QUEUEA and QUEUEB using the same QueueManager Connection Handle

It's a restriction in MQ (a reasonable restriction, I think) that you can only do one thing at a time on one hConn.

If you want independent simultaneous MQ activity, you need 2 hConns and 2 threads.

It may help us to comment more helpfully if you would explain why you wish to get messages "simultaneously".
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 19, 2006 3:20 pm    Post subject: Reply with quote

Grand High Poobah

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

Don't do this
Quote:
for (int i = o; i < Queueno.length; i++)
in the MQOPEN i am Passing the Queuearray[i]
Wait Unlimited Option Specified in get Message Options
MQGET
}
but get the messages on the queue until receiving RC 2033 queue empty.
Search the forum to know why.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
nik_iway
PostPosted: Wed Jul 19, 2006 8:34 pm    Post subject: Reply with quote

Centurion

Joined: 21 Jul 2005
Posts: 115

Hi,
I Have a Queuemanager on windows with two queues named QUEUEA and QUEUEB receiving same information but each Queue receiving information from different location say QUEUEA receiving information from LONDON and QUEUEB from NEWYORK. I want to get message from both Queues and write it to a directory. The Present logic that i had written

While(true)
{
for (int i = o; i < Queueno.length; i++)
in the MQOPEN i am Passing the Queuearray[i]
Wait Unlimited Option Specified in get Message Options
MQGET
}

First its going and picking the message from QUEUEA and then QUEUEB and Again back to QUEUEA then QUEUEB and so on...........so if there is no messages in QUEUEA its getting locked... In the Mean time QUEUEB will be filled with Messages from diifferent location.. I just want to by pass the locked state in QUEUEA and go to QUEUEB to pick up the Messages.

I used int depth = Queue.currentdepth()
if (depth == 0)
{
increment the QueueArray
}
else
{

MQOPEN i am Passing the Queuearray[i]
Wait Unlimited Option Specified in get Message Options
MQGET
}

QUEUEA has no messages and QUEUEB has one Messages . the progam is going and picking up in the QUEUEB but its also getting locked in the QUEUEB.....

Is there any alternative way to reach my goal.....

Regards
Nik
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jul 19, 2006 11:33 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

First - why have you ignored the comment of fjb_saper and are still not looping until 2033? Your method is really not a good one & I'm wondering why you have persisted with it - what's the design logic here?

Second - Is it always the case that QUEUEA and QUEUEB have matching records? How are they matched one to the other? What is the requirement when one side is delayed (e.g. network problems) or indeed not sent at all due to logic error / hardware failure?

A few more details please to assist with a proposed solution.
_________________
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 Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQOPEN() simultaneously for 2 Queues
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.