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 IndexIBM MQ Java / JMSProblem on creating new stream for publish/subscribe in MQ 6

Post new topicReply to topic
Problem on creating new stream for publish/subscribe in MQ 6 View previous topic :: View next topic
Author Message
d_lam
PostPosted: Sun Aug 14, 2011 7:54 pm Post subject: Reply with quote

Newbie

Joined: 14 Aug 2011
Posts: 5

I am developing a sample program for using publish subscribe message in Websphere MQ 6.0.2.2.
In this program, I want to use a self-defined stream for handling the message and have the following set-up in MQ.

Code:
DEFINE QLOCAL('SYSTEM.JMS.ADMIN.QUEUE') REPLACE DEFPSIST(YES) NOSHARE
DEFINE QLOCAL('SYSTEM.JMS.PS.STATUS.QUEUE') REPLACE DEFPSIST(YES) SHARE DEFSOPT(SHARED)
DEFINE QLOCAL('SYSTEM.JMS.REPORT.QUEUE') REPLACE DEFPSIST(YES) SHARE DEFSOPT(SHARED)
DEFINE QMODEL('SYSTEM.JMS.MODEL.QUEUE') REPLACE DEFTYPE(PERMDYN) SHARE DEFSOPT(SHARED)
DEFINE QLOCAL('SYSTEM.JMS.ND.SUBSCRIBER.QUEUE') REPLACE DEFPSIST(YES) SHARE DEFSOPT(SHARED) MAXDEPTH(100000)
DEFINE QLOCAL('SYSTEM.JMS.ND.CC.SUBSCRIBER.QUEUE') REPLACE DEFPSIST(YES) SHARE DEFSOPT(SHARED) MAXDEPTH(100000)
DEFINE QLOCAL('SYSTEM.JMS.D.SUBSCRIBER.QUEUE') REPLACE DEFPSIST(YES) SHARE DEFSOPT(SHARED) MAXDEPTH(100000)
DEFINE QLOCAL('SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE') REPLACE DEFPSIST(YES) SHARE DEFSOPT(SHARED) MAXDEPTH(100000)
DEFINE QLOCAL('SYSTEM.BROKER.DEFAULT.STREAM.TEST1') DEFPSIST(YES) SHARE DEFSOPT(SHARED) MAXDEPTH(100000)
DEFINE QLOCAL('SYSTEM.JMS.ND.SUBSCRIBER.QUEUE.TEST1') DEFPSIST(YES) SHARE DEFSOPT(SHARED) MAXDEPTH(100000)

DEFINE CHANNEL('PubSub.SERV.CHAN') CHLTYPE(SVRCON)
DEFINE CHANNEL('PubSub.CLT.CHAN') CHLTYPE(SVRCON)

DEFINE LISTENER('PubSub.SERV.SERV.LISTENER') TRPTYPE(TCP) PORT(60004)

And in the JMSAdmin, I have defined the following.

1.
Code:
DEFINE TCF(PubSub.Sub.TCF) QMANAGER(PubSubQM) TRANSPORT(CLIENT) PORT(60004) CHANNEL(PubSub.SERV.CHAN) HOSTNAME(hostname);
DEFINE T(PubSub/T2) TOPIC(PubSub.test2)

2.
Code:
DEFINE TCF(PubSub.Pub.TCF) QMANAGER(PubSubQM) TRANSPORT(CLIENT) PORT(60004) CHANNEL(PubSub.SERV.CHAN) HOSTNAME(hostname) BROKERPUBQ(SYSTEM.BROKER.DEFAULT.STREAM.TEST1) BROKERSUBQ(SYSTEM.JMS.ND.SUBSCRIBER.QUEUE.TEST1) BROKERQMGR(QM) BROKERVER(V1)
DEFINE T(PubSub/T1) TOPIC(PubSub.test1) BROKERPUBQ(SYSTEM.BROKER.DEFAULT.STREAM.TEST1) BROKERPUBQMGR(QM)


When I used the first set-up of JMS config, I can publish and subscribe the topic with the default stream.
However, when I used the second set-up, the message is queued in STREAM.TEST1 but the following exception comes out.
Code:
MQJMS5053: *** No broker response. Please ensure that the broker is running. If you are using the WebSphere MQ broker check that your brokerVersion is set to V1 ***
com.ibm.mq.jms.NoBrokerResponseException: MQJMS5053: *** No broker response. Please ensure that the broker is running. If you are using the WebSphere MQ broker check that your brokerVersion is set to V1 ***
        at com.ibm.mq.jms.MQPubSubServices.getBrokerResponse(MQPubSubServices.java:482)
        at com.ibm.mq.jms.JMSServicesMgr.getBrokerResponse(JMSServicesMgr.java:185)
        at com.ibm.mq.jms.MQMessageProducer.checkBrokerResponse(MQMessageProducer.java:3075)
        at com.ibm.mq.jms.MQMessageProducer.publishInt(MQMessageProducer.java:2131)
        at com.ibm.mq.jms.MQMessageProducer.publishInt(MQMessageProducer.java:2199)
        at com.ibm.mq.jms.MQTopicPublisher.publish(MQTopicPublisher.java:237)
        at JMSPubSub.JMSPub.run(JMSPub.java:69)
        at java.lang.Thread.run(Thread.java:811)


I have searched in the internet and it is hard to find the related documents.Could anyone know what's going on? Thanks.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Aug 14, 2011 11:02 pm Post subject: Reply with quote

Grand High Poobah

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

You've missed some steps setting up the alternate stream queue. Nobody's listening there... Back to the Pub/Sub manual!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
d_lam
PostPosted: Mon Aug 15, 2011 6:19 pm Post subject: Reply with quote

Newbie

Joined: 14 Aug 2011
Posts: 5

Does it mean that I need to send a register publisher command message from publisher to broker's control queue?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Aug 15, 2011 7:46 pm Post subject: Reply with quote

Grand High Poobah

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

d_lam wrote:
Does it mean that I need to send a register publisher command message from publisher to broker's control queue?

So what does the pub/sub manual say about setting up an alternate publication stream?

Can you quote the passages and what you have done to comply with them?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
d_lam
PostPosted: Tue Aug 16, 2011 11:38 pm Post subject: Reply with quote

Newbie

Joined: 14 Aug 2011
Posts: 5

I am using the pain broker come from the WebSphere MQ v6.0
According to the redbook "MQSeries Publish/Subscribe Applications":
Quote:
When using the publish/subscribe functionality of MQSeries, the queues used for publications are stream queues. There is one default stream queue called SYSTEM.BROKER.DEFAULT.STREAM. By default, this queue is used for all publications. An administrator can create other stream queues. The first time a new stream queue is used, a register publisher command must be issued to make the broker aware of its new configuration or it will ignore this stream queue until a subscriber subscribes specifying this stream queue. Stream queues can be used to spread messages across more than one queue when a lot of messages are published in a short time. See 4.11.2, “Streams” on page 108.
When using the publish/subscribe functionality of MQSeries Integrator, the
queues used for publications are the queue or queues mentioned in the input node or nodes of the message flow containing the publication node.
Depending on the programming method used, the publication queues are
defined:
In JMS: when creating the TopicConnectionFactory in JNDI (Java Naming and Directory Interface), the publication queue is indicated in the parameter BROKERPUBQ whose value defaults to SYSTEM.BROKER.DEFAULT.STREAM


And as I posted earlier, I have define the topic connection factory with BROKERPUBQ
Code:
BROKERSUBQ(SYSTEM.JMS.ND.SUBSCRIBER.QUEUE.TEST1)


Moreover, from the help page provided by IBM,
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.amqnar.doc/ps11850_.htm

it just tells that the queue will create dynamically instead of how to create them...[/quote]
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Aug 16, 2011 11:42 pm Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

All much easier in WMQ v7.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 17, 2011 8:09 am Post subject: Reply with quote

Grand High Poobah

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

d_lam wrote:

And as I posted earlier, I have define the topic connection factory with BROKERPUBQ
Code:
BROKERSUBQ(SYSTEM.JMS.ND.SUBSCRIBER.QUEUE.TEST1)


Moreover, from the help page provided by IBM,
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.amqnar.doc/ps11850_.htm

it just tells that the queue will create dynamically instead of how to create them...

OK now we're seeing some light.
This shows me that you have no understanding what a stream queue is or is for...

A STREAM queue is for the sole purpose of publishing messages. By convention it's name should end with STREAM.

The JMS manual and report back on the usage of the SYSTEM.JMS.ND.SUBSCRIBER* queues and see what you did wrong...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
d_lam
PostPosted: Wed Aug 17, 2011 6:02 pm Post subject: Reply with quote

Newbie

Joined: 14 Aug 2011
Posts: 5

Sorry, there is a typo in my previous reply... I had quoted the wrong section of TCF definition. I have used this definition before.

Code:
BROKERPUBQ(SYSTEM.BROKER.DEFAULT.STREAM.TEST1) BROKERSUBQ(SYSTEM.JMS.ND.SUBSCRIBER.QUEUE.TEST1)


By the way, I have also tried the following definition but it failed again.
Code:

DEFINE TCF(PubSub.Pub.TCF) QMANAGER(PubSubQM) TRANSPORT(CLIENT) PORT(60004) CHANNEL(PubSub.SERV.CHAN) HOSTNAME(hostname) BROKERPUBQ(SYSTEM.BROKER.USER.STREAM) BROKERSUBQ(SYSTEM.JMS.D.SUBSCRIBER.QUEUE.TEST1) BROKERQMGR(PubSubQM) BROKERVER(V1) CLIENTID(CLT)
DFFINE T(PubSub.T1) TOPIC(PubSub/test1) BROKERPUBQ(SYSTEM.BROKER.USER.STREAM) BROKERPUBQMGR(PubSubQM) BROKERDURSUBQ(SYSTEM.JMS.D.SUBSCRIBER.QUEUE.TEST1)


The queue name starts with SYSTEM.JMS.ND.* is used for non-durable subscription queue and starts with SYSTEM.JMS.D.* is used for durable subscription queue, right ?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 17, 2011 7:39 pm Post subject: Reply with quote

Grand High Poobah

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

Sounds about right and the code shown above looks about right too.

If you still face problems there open a PMR with IBM.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexIBM MQ Java / JMSProblem on creating new stream for publish/subscribe in MQ 6
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.