|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XMS C# - Queue Open versus Queue Create |
« View previous topic :: View next topic » |
Author |
Message
|
kayoumt |
Posted: Sun Jun 14, 2009 8:47 am Post subject: XMS C# - Queue Open versus Queue Create |
|
|
Voyager
Joined: 18 Sep 2007 Posts: 81
|
Hi,
In some situations, I need to make two applications to concurrently read or write on an already existing (created) queue.
In C++, it seems that just creating a Destination object does the job.
Destination my_shared_queue = Destination(XMS_DESTINATION_TYPE_QUEUE,"MY.SHARED.QUEUE");
In C# ; it seems it is not possible to do it that way ; because I cannot call an IDestination object's constructor. To create that IDestination "object", I need to call a method from IConnection, ISeesion or IConnectionFactory.
Anyway ; calling ISession.CreateQueue for that future does not return a handle on an existing queue ; but, tries to physically create the queue and raises an exception when the queue already exists.
IDestination my_shared_queue = my_session.CreateQueue("MY.SHARED.QUEUE");
Thanks in advance for any help. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Jun 14, 2009 6:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Raise a PMR. Session.CreateQueue should never try to physically create a queue. However check the Reason code first. Maybe there is a reason that you get an exception like queue open in exclusive mode...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kayoumt |
Posted: Sun Jun 14, 2009 6:45 pm Post subject: |
|
|
Voyager
Joined: 18 Sep 2007 Posts: 81
|
Thanks for your answer.
I solved that issue. The listeners of my queue manager was stopped ; that's why I was getting that exception. Now ; CreateQueue returns an open queue handle even queue is shared by several applications.
Solved ! |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|