Author |
Message
|
kun.leeing |
Posted: Mon Jan 05, 2009 1:08 am Post subject: XMS Pub/Sub on linux |
|
|
 Disciple
Joined: 27 Sep 2008 Posts: 171
|
Hi, experts.
I encountered a question about XMS.
simplified code like this:
Code: |
pConnFact = new xms::ConnectionFactory();
pConnFact->setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_WMQ);
pConnFact->setIntProperty(XMSC_WMQ_PORT, 1415);
pConnFact->setIntProperty(XMSC_WMQ_BROKER_VERSION, 1);
pConnFact->setIntProperty(XMSC_WMQ_CONNECTION_MODE, XMSC_WMQ_CM_CLIENT);
pConnFact->setStringProperty(XMSC_WMQ_HOST_NAME, "192.168.0.107");
pConnFact->setStringProperty(XMSC_WMQ_QUEUE_MANAGER, "QMANAGER");pConnFact->setStringProperty(XMSC_WMQ_CHANNEL,"SERVERCONN.CHANNEL");
conn = pConnFact->createConnection();
expLsr.connected(xmsTRUE);
conn.setExceptionListener(&expLsr);
sess = conn.createSession(xmsFALSE, XMSC_AUTO_ACKNOWLEDGE);
dest = xms::Destination("topic://SAC.CLIENTS.RECV");
consumer = sess.createConsumer(dest);
|
it goes through until the last line 'sess.createConsumer(dest)' and then hold a long time at the line before throw the following error
Exception:
ErrorData =
ErrorCode = 30 (XMS_E_PROTOCOL_ERROR)
JMS Type = 1 (XMS_X_GENERAL_EXCEPTION)
Linked Exception:
ErrorData = MQGET(Q=SYSTEM.JMS.REPORT.QUEUE,QMGR=ZH110.SACRIFICED.QMANAGER)
ErrorCode = 2033 (MQRC_NO_MSG_AVAILABLE)
JMS Type = 1 (XMS_X_GENERAL_EXCEPTION)
how can it be solved? |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 05, 2009 2:30 am Post subject: Re: XMS Pub/Sub on linux |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kun.leeing wrote: |
how can it be solved? |
By publishing new topics endlessly?
Why is this a problem? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kun.leeing |
Posted: Wed Jan 14, 2009 4:38 pm Post subject: |
|
|
 Disciple
Joined: 27 Sep 2008 Posts: 171
|
Following the code above, i have the message receiving code,but
the code will not pass the line of createConsumer(Topicstring) and throw the error above.
if i change Topicstring to Queue name like 'queue:///queue.lqueue', it will work, but topicstring give the error. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 14, 2009 9:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kun.leeing wrote: |
Following the code above, i have the message receiving code,but
the code will not pass the line of createConsumer(Topicstring) and throw the error above.
if i change Topicstring to Queue name like 'queue:///queue.lqueue', it will work, but topicstring give the error. |
kun.leeing wrote: |
dest = xms::Destination("topic://SAC.CLIENTS.RECV");
consumer = sess.createConsumer(dest); |
Don't know much about that piece of code...
Have you tried:
Code: |
String topicString = "topic://SAC.CLIENTS.RECV"; //uri form of the topic
xms::Destination mydest = sess.createTopic(topicString); //creating the topic using the uri form
consumer=sess.createConsumer(mydest); |
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/uj25070_.htm
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kun.leeing |
Posted: Wed Jan 14, 2009 10:16 pm Post subject: |
|
|
 Disciple
Joined: 27 Sep 2008 Posts: 171
|
Thanks, fjb_saper.
I'll try it.  |
|
Back to top |
|
 |
kun.leeing |
Posted: Tue Jan 20, 2009 6:12 pm Post subject: |
|
|
 Disciple
Joined: 27 Sep 2008 Posts: 171
|
the problem remain.
And this time I fixed MQ 6.0.2.5 patch,but it didn't seem to work.
It still can not create consumer for pub/sub app. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 21, 2009 3:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kun.leeing wrote: |
the problem remain.
And this time I fixed MQ 6.0.2.5 patch,but it didn't seem to work.
It still can not create consumer for pub/sub app. |
Remarkably your topic name looks like a queue name.
Check out the URI form of topics. The queue name has nothing at all to do with the topic. Can you try with a topic name that has not "." in it?
Topic separators should be "/" and not "." ....
As well the Uri form allows you to specify a delivery queue. However this still needs to be in form of SYSEM.JMS.* something. java manual, pub/sub manual  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kun.leeing |
Posted: Wed Jan 21, 2009 6:14 am Post subject: |
|
|
 Disciple
Joined: 27 Sep 2008 Posts: 171
|
Thanks for your reply,saper.
That's really a problem.
And I change it to the a topic string like 'topic://Center' ,but the question still is not resolved.
Pub/Sub consumer can not be created. Oddly, the consumer with queue destination can work correctly.Is this a bug on ia94 or anything I do not make? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 21, 2009 2:21 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It should work right.
For a subscription to go to a specific queue the uri should look something like this:
"topic://mytopic/#?brokerDurSubQueue=SYSTEM.JMS.D.PUBLIB&brokerVersion=1"
Here SYSTEM.JMS.D.PUBLIB is a alias for the real queue.
This was done because the queue name "HAS" to start with "SYSTEM.JMS.D."
Enjoy
Nota: I believe I used the wildcard chars for Version 2 in my topic... _________________ MQ & Broker admin |
|
Back to top |
|
 |
kun.leeing |
Posted: Tue Feb 10, 2009 6:49 am Post subject: |
|
|
 Disciple
Joined: 27 Sep 2008 Posts: 171
|
Oh, I must say sorry,saper.
It's my false.
But now , I know how to do this.
Thanks for your help.
 |
|
Back to top |
|
 |
|