in

mscommunity.net

Interactive mscommunity.net online activities

DamirDobric

IBM.XMS Error CWSMQ0180E - Creating of Subscriber via Queue

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);
                         }
                     }
                 }
             }
         }
     }

Read the complete post at http://developers.de/blogs/damir_dobric/archive/2008/09/15/ibm-xms-error-cwsmq0180e-creating-of-subscriber-via-queue.aspx

Published ruj 15 2008, 10:01 by anonymous
Filed under:
Powered by Community Server (Commercial Edition), by Telligent Systems