developers.de
daenet's .NET Community

IBM.XMS Error CWSMQ0180E - Creating of Subscriber via Queue

Damir Dobric Posts

 

Damir@Phone    



My upcoming sessions:

AppFabric Applications at
NRW Conf 2011
09.Sept.2011 Wuppertal

HTML5 widgets in WP7+
Monodroid
Mobility Day
21.Sept.2011 - Zagreb

AppFabric and WCF sessions at
Advanced Developer Conference
26.-27. Oktober 2011 in Frankenthal

AppFabric Applications, queues, topics and more at
Prio Conference
02. - 03. November 2011 in Meistersingerhalle Nürnberg

AppFabric Applications deep dive hosted by
.NET User Group Frankfurt
17.Nov.2011 18.30-22.30 Microsoft - Bad Homburg 

 

 

When trying to initialize Ibm.Xms durable subscriber you may get following error:

CWSMQ0180E: The name is not valid for this Destination : durablesubscription.test. An application supplied an invalid name for the Destination. Check the supplied name conforms to Naming and URI specification.

The error description is a bit wired, because the reason why the error is thrown can be wrong initialization. It is important to know,
that durable subscriber should be used with topic based communication only. If the queue based communication is initialized
the common consumer (session.CreateConsumer()) should be used instead of durable subscriber (session.CreateDurableSubscriber()).

The example below shows using of durable subscriber based on queue communication. This will throw the error described below.

image

Unformatted code below:

static void createQueue()
     {
         IConnectionFactory cf = getFactory();

         using (IConnection connection = cf.CreateConnection(null, null))
         {
             connection.ClientID = "SomeUniqueText";

             using (ISession session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge))
             {
                 using (IDestination destination = session.CreateQueue("queue://durablesubscription.test"))
                 {
                     destination.SetIntProperty(XMSC.DELIVERY_MODE, 1); //"non-persistent"

                     //using (IMessageConsumer consumer = session.CreateConsumer(destination))
                     using (IMessageConsumer consumer = session.CreateDurableSubscriber(destination, "DurableSubscription3"))
                     {
                         // IMessageConsumer consumer2 = session.CreateDurableSubscriber(destination, "DurableSubscription1");

                         IMessageProducer producer = session.CreateProducer(destination);

                         connection.Start();

                         int cnt = 3;

                         IMessage recvMsg = null;
                         while (--cnt > 0)
                         {
                             // Receive the message                                   
                             recvMsg = consumer.Receive();
                             producer.Send(recvMsg);
                         }
                     }
                 }
             }
         }
     }


Posted Sep 15 2008, 10:01 PM by Damir Dobric
Filed under:

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
daenet GmbH