Author |
Message
|
marcin.kasinski |
Posted: Wed Mar 19, 2008 1:50 am Post subject: Testing Pub-Sub durable scenario. |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
I have small JMSSubscriber application.
In this application I create durable subscriber on topic and receive published messages.
When I run this application everything works fine.
But when I run another instance of this application I get “
Broker command failed: MQRCCF_SUBSCRIPTION_LOCKED Reason code 3156.”
I red that I can change optional parms for registering.
I tried with CONNOPT(SHARED) of topic connection factory in my JMSAdmin script, but it doesn’t work.
My question is : how can I share this durable subscription ?
I mean how can I receive published messages with 2,3,4,… open MQ connections. I can not find this information. _________________ Marcin
Last edited by marcin.kasinski on Thu Mar 20, 2008 1:45 pm; edited 1 time in total |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Mar 19, 2008 2:44 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed Mar 19, 2008 3:08 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Hi,
Thanks for reply.
I know his examples.
Problem is that I can not specify different id.
If I specify different id every instance will receive the same message.
From my point of view these are duplicated messages.
In my scenario I would like to receive message from queue and process it by instance.
And do the same concurrently by other instances. I expect every instance processing own unique messages. _________________ Marcin
Last edited by marcin.kasinski on Thu Mar 20, 2008 1:47 pm; edited 1 time in total |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Mar 19, 2008 5:24 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
marcin.kasinski wrote: |
If I specify different id every instance will receives the same message.
From my point of view these are duplicated messages. |
This is the point of publish/subscribe. All of the subscribers should get a copy of the message.
I think I'm confused on what you are trying to do. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed Mar 19, 2008 6:23 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
bower5932 wrote: |
This is the point of publish/subscribe. All of the subscribers should get a copy of the message.
I think I'm confused on what you are trying to do. |
I’m just testing multi-threading or multi-process scenario.
Let say every message is processed 10 minutes.
I’m trying to run run 10 instances the same application to increase performance (many instances the same subscriber ).
I hope now it is clear. _________________ Marcin |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 19, 2008 6:29 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
marcin.kasinski wrote: |
I’m trying to run run 10 instances the same application to increase performance (many instances the same subscriber ).
I hope now it is clear. |
Not really.
Do you mean that the same message processed simultaniously by 10 applications - how do the different application avoid duplication of effort?
Or do you mean that each message takes 10 minutes to process, hence the next message arrives before the previous one has finished processing and you want it picked up and started by another instance? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 19, 2008 6:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Create one instance that is the subscriber, and the rest of the instances as plain listeners. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed Mar 19, 2008 12:40 pm Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Vitor wrote: |
Or do you mean that each message takes 10 minutes to process, hence the next message arrives before the previous one has finished processing and you want it picked up and started by another instance? |
Yes. This is a problem. _________________ Marcin |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed Mar 19, 2008 12:41 pm Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
jefflowrey wrote: |
Create one instance that is the subscriber, and the rest of the instances as plain listeners. |
Thanks jefflowrey for reply.
It is very simple solution and I've tested it already.
I thought there is another "better" way. _________________ Marcin |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 19, 2008 2:28 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
RFHUtil allows for a "shared subscription". But you'd have to read up on it and how it works. I am not sure that the plain MQBroker will care for it or allow it.
Make sure that your Topic defines a delivery queue that is unique for your usage. Any QueueSession can then create a Receiver for this queue Destination. When you receive the message it will still show the Topic in the destination...
The big difference there is that you will not filter the topics anymore. Any message on the queue is game....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Thu Mar 20, 2008 1:44 pm Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
Hi,
I've tested my multi-instance scenario.
It works if I set CLONESUPP(ENABLED) on TCF. _________________ Marcin |
|
Back to top |
|
 |
|