ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem Trying to Create Consumer using XMS.NET API

Post new topic  Reply to topic
 Problem Trying to Create Consumer using XMS.NET API « View previous topic :: View next topic » 
Author Message
tmeinershagen
PostPosted: Mon Nov 12, 2007 3:45 pm    Post subject: Problem Trying to Create Consumer using XMS.NET API Reply with quote

Newbie

Joined: 12 Nov 2007
Posts: 1

I have properly set up MQ in our System i environment for the use of JMS. Our Java clients can adequately publish and subscribe to a given topic. However, when I use the XMS.NET client library, I am only able to publish - not consume or subscribe to those topics.

I am getting an exception when trying to connect by calling the following (the exception is encountered after hanging for the specified connection timeout period):

this._consumer = this._session.CreateDurableSubscriber(this._topic, this._properties[ConnectionProperty.TOPIC_SUBSCRIPTION_NAME], this._properties[ConnectionProperty.WMQ_MESSAGE_SELECTOR], false);

The error is as follows:

CWSMQ0006E: An exception was received during the call to the method WmqSubscriptionEngine.GetBrokerReponse: CompCode: 2, Reason: 2033. During execution of the specified method an exception was thrown by another component. See the linked exception for more information. ---> IBM.XMS.XMSException: CWSMQ0006E: An exception was received during the call to the method WmqSubscriptionEngine.GetBrokerReponse: CompCode: 2, Reason: 2033. During execution of the specified method an exception was thrown by another component. See the linked exception for more information..

The 2033 error code means that no message is available. I have set up the following properties when setting up the connection properties:

this._factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
this._connectionFactory = this._factoryFactory.CreateConnectionFactory();

this._connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, this._properties[ConnectionProperty.WMQ_HOST_NAME]);
this._connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, this._properties[ConnectionProperty.WMQ_QUEUE_MANAGER]);
this._connectionFactory.SetIntProperty(XMSC.WMQ_PORT, System.Convert.ToInt32(this._properties[ConnectionProperty.WMQ_PORT]));
this._connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, this._properties[ConnectionProperty.WMQ_CHANNEL]);
this._connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);
this._connectionFactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
this._connectionFactory.SetStringProperty(XMSC.CLIENT_ID, this._properties[ConnectionProperty.CLIENT_ID]);
this._connectionFactory.SetIntProperty(XMSC.WMQ_MESSAGE_SELECTION, XMSC.WMQ_MSEL_CLIENT);

this._connection = _connectionFactory.CreateConnection(this._properties[ConnectionProperty.USERID], this._properties[ConnectionProperty.PASSWORD]);
this._session = _connection.CreateSession(false, AcknowledgeMode.ClientAcknowledge);
this._connection.Start();

I am not able to use the JNDI that Java uses to make my connection, because we are not able at this point to install the web service on our System i environment.

Does anyone have any answers as to why my connection works only during publishing but not during subscription?

Thanks for your help...
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Nov 12, 2007 6:25 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

What happens if you comment out this part of the code?
this._properties[ConnectionProperty.WMQ_MESSAGE_SELECTOR], false

I am not sure that you are allowed to do something like this.
If I have no selector I would skip this line altogether....

A selector is not a boolean component but a string containing the "where" clause...

As such it tells me that your subscription is working as designed: your message selector ensures that you will never get a message which is corroborated by the 2033 (no message in queue matching criterion and in a getable state)

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Problem Trying to Create Consumer using XMS.NET API
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.