You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "yashasvi (JIRA)" <ji...@apache.org> on 2016/05/19 06:32:13 UTC
[jira] [Created] (AMQNET-552) Creating two consumers on a single
session in XMS
yashasvi created AMQNET-552:
-------------------------------
Summary: Creating two consumers on a single session in XMS
Key: AMQNET-552
URL: https://issues.apache.org/jira/browse/AMQNET-552
Project: ActiveMQ .Net
Issue Type: Bug
Components: XMS
Reporter: yashasvi
Assignee: Jim Gomes
Hi, I am trying to create two consumers on a single session using the xms provider, but facing this error :
{"CWSMQ0101E: Synchronous method call not permitted when a session is being used asynchronously: CreateConsumer.\r\nThe XMS specification does not permit the use of a session for synchronous methods when asynchronous message delivery is running.\r\nCreate a separate session if you wish to use both synchronous methods and asynchronous delivery simultaneously."}
But, when I am trying to do the same thing by directly using the ibm.xms library, I am able to do so.
So, is this a limitation of the nms xms provider ? If that is the case, why does the exception states that XMS specification does not permit it.
Below are the codes for two different cases :
Using NMS provider :
ConnectionFactory factory = new ConnectionFactory(new Uri("****?wmq.channelname=***&queuemanagername=***"));
Apache.NMS.IConnection conn = factory.CreateConnection("userid", "pwd");
conn.Start();
ISession se = conn.CreateSession();
IDestination qu = se.GetQueue("***");
IMessageConsumer consumer = se.CreateConsumer(qu);
IMessageConsumer consumer2 = se.CreateConsumer(qu);
This is giving me error.
Using IBM.XMS directly :
IConnection connection = factory.CreateConnection();
connection.Start();
ISession se = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
IDestination des = se.CreateQueue("***");
IDestination des2 = se.CreateQueue("***");
IMessageConsumer consu = se.CreateConsumer(des);
IMessageProducer prod = se.CreateProducer(des);
IMessageConsumer consu2 = se.CreateConsumer(des);
This is working fine.
Please help.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)