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 API Support » MQ PubSub Issues.

Post new topic  Reply to topic
 MQ PubSub Issues. « View previous topic :: View next topic » 
Author Message
kakkarj
PostPosted: Wed Aug 05, 2009 1:03 am    Post subject: MQ PubSub Issues. Reply with quote

Novice

Joined: 03 Aug 2009
Posts: 10

I am having issues with MQ Pub/Sub. Following are the steps that I followed, however I am not able to get this working.
Could you please let me know what am I missing here. Also is there a way we can check what subscriptions are being registered with MQ Broker?


Steps for MQ Pub Sub :

1. Ensure that the MQ broker is running.
dpsmqbrk -m QM_Name : The MQ Pub-Sub broker for the queue manager QM_Name is running.


2. RFH Message to register the subscription : The message is being sent to SYSTEM.BROKER.CONTOL.QUEUE

String registerSub = "MQPSCommand RegSub MQPSTopic JKTopic";
int mqStructLen = MQC.MQRFH_STRUC_LENGTH_FIXED_1 + registerSub.length();

theMsg.format = MQC.MQFMT_RF_HEADER_1; // Msg Format
theMsg.replyToQueueName = queue_naem;
theMsg.replyToQueueManagerName = queueManagerName;
theMsg.writeString(MQC.MQRFH_STRUC_ID); // StrucId
theMsg.writeInt4(MQC.MQRFH_VERSION_1); // Version
theMsg.writeInt4(mqStructLen); // StrucLength
theMsg.writeInt4(MQC.MQENC_NATIVE); // Encoding
theMsg.writeInt4(MQC.MQCCSI_INHERIT); // CodedCharacterSetId
theMsg.writeString(MQC.MQFMT_STRING); // Format (content)
theMsg.writeInt4(MQC.MQRFH_NO_FLAGS); // Flags
theMsg.writeInt4(1208); // NameValueCCSID = UTF-8
theMsg.writeString(registerSub);


3. Publish Message : The message is being sent to SYSTEM.BROKER.DEFAULT.STREAM

String publishMsg = "MQPSCommand Publish MQPSTopic JKTopic";
int mqStructLen = MQC.MQRFH_STRUC_LENGTH_FIXED_1 + registerSub.length();

theMsg.format = MQC.MQFMT_RF_HEADER_1; // Msg Format
theMsg.writeString(MQC.MQRFH_STRUC_ID); // StrucId
theMsg.writeInt4(MQC.MQRFH_VERSION_1); // Version
theMsg.writeInt4(mqStructLen); // StrucLength
theMsg.writeInt4(MQC.MQENC_NATIVE); // Encoding
theMsg.writeInt4(MQC.MQCCSI_INHERIT); // CodedCharacterSetId
theMsg.writeString(MQC.MQFMT_STRING); // Format (content)
theMsg.writeInt4(MQC.MQRFH_NO_FLAGS); // Flags
theMsg.writeInt4(1208); // NameValueCCSID = UTF-8
theMsg.writeString(publishMsg);


Appreciate your help and support.

Regards
JK
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Aug 05, 2009 4:03 am    Post subject: Re: MQ PubSub Issues. Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kakkarj wrote:
I am having issues with MQ Pub/Sub.


Which version of WMQ? v6 or v7?

Doesn't work in what way?

Have you tried displaying the subscriptions?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kakkarj
PostPosted: Wed Aug 05, 2009 4:31 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2009
Posts: 10

Thanks for your reply. I am using MQ 6.1.0.3. The pub sub works with WMB however I am supposed to use MQ Pub/Sub.

Could you please let me know how do I list subscriptions if I am using MQ Pub/Sub.

The subscribers are not receiving message when I publish a message to SYSTEM.BROKER.DEFAULT.QUEUE.
Back to top
View user's profile Send private message
vol
PostPosted: Wed Aug 05, 2009 5:43 am    Post subject: Reply with quote

Acolyte

Joined: 01 Feb 2009
Posts: 69

Quote:

how do I list subscriptions


Quote:

The subscribers are not receiving message when I publish a message to SYSTEM.BROKER.DEFAULT.QUEUE.


Publish the message by putting it to SYSTEM.BROKER.CONTROL.QUEUE. The broker will do all the routing, including putting the msg to the subscriber queue.
Back to top
View user's profile Send private message
kakkarj
PostPosted: Wed Aug 05, 2009 6:14 am    Post subject: Reply with quote

Novice

Joined: 03 Aug 2009
Posts: 10

I tried publishing the message to SYSTEM.BROKER.CONTROL.QUEUE, however the subscribers are not receiving the messages.

Moreever the Pub Sub guide says that message shall be published to SYSTEM.BROKER.DEFAULT.STREAM.

Any more hints?
Back to top
View user's profile Send private message
vol
PostPosted: Wed Aug 05, 2009 10:57 pm    Post subject: Reply with quote

Acolyte

Joined: 01 Feb 2009
Posts: 69

Sorry, I was wrong. Publish msgs should be put to the stream queue.

The reason the subscriber app is not getting any msgs is that it is not subscribed to the same topic as the publish app is publishing on.

Check subs using amqspsd.
Check that the topics match
Put a reply to queue in the MD when putting the control msgs, and check the reply queue to see if any errors are being reported.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » MQ PubSub Issues.
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.