|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
iMessageConsumer - how does one reply to the message |
« View previous topic :: View next topic » |
Author |
Message
|
fjb_saper |
Posted: Fri Aug 21, 2009 2:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
As to the solution... I am not so familar with the .NET XMS package but I am surprised by this part of your code:
JeffTheDotNetGuy wrote: |
Code: |
If oTopic Is Nothing Then
oTopic = oFactory.CreateQueue("TestQueue")
End If
|
|
I would have expected your oTopic to be of type Destination and not use a "Topic" name for what is essentially a "Queue".
I know semantics, but it helps clarifying for newbies...
So again
Destination is the generic type object. Valid instances objects for the Destination are Queue and Topic. Note that Queue and Topic will behave somewhat differently but most of the methods will take the Destination object, so Queue and Topic may for all purposes appear as interchangeable.
Once you look into pub/sub you realize that they are not (interchangeable that is).
Have fun.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
shashikanth_in |
Posted: Sun Aug 23, 2009 6:03 am Post subject: |
|
|
Centurion
Joined: 26 Feb 2009 Posts: 123
|
Hmmm. Saw this post very late. Yes, XMS internally creates a temporary queue on which response is recieved in a reques/response type of messaging. Please note that the scope of the temporary queue is connection and hence can't be used accross different connections. |
|
Back to top |
|
 |
JeffTheDotNetGuy |
Posted: Mon Aug 24, 2009 2:50 am Post subject: |
|
|
Novice
Joined: 21 Aug 2009 Posts: 10
|
Yes, sir. Originally my intention was to code to a topic, but wound up going with a queue and never updated my code. Sorry new folks. Those objects you see at the top of my function there are all thread-safe, so I am holding a single instance of each globally for reference by every thread in the service. (I should have posted those global definitions):
Code: |
Public oFactory As IBM.XMS.XMSFactoryFactory
Public oConnectionFactory As IBM.XMS.IConnectionFactory
Public oConnection As IBM.XMS.IConnection
Public oTopic As IBM.XMS.IDestination
|
And yes... that temporary queue is easily accessed by referencing the message's ReplyTo object. The shared connection instance avoids any problems.
Code: |
Dim oReplier As IBM.XMS.IMessageProducer = oSession.CreateProducer(oCurrMessage.JMSReplyTo)
|
|
|
Back to top |
|
 |
|
|
|
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
|
|
|
|