Author |
Message
|
PeterPotkay |
Posted: Tue Jul 17, 2007 12:09 pm Post subject: Subscriber versus Consumer |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
BROKERCCDURSUBQ
The name of the queue from which durable subscription messages are retrieved for a ConnectionConsumer
BROKERCCSUBQ
The name of the queue from which non-durable subscription messages are retrieved for a ConnectionConsumer
versus
BROKERDURSUBQ
The name of the queue from which durable subscription messages are retrieved
BROKERSUBQ
The name of the queue from which non-durable subscription messages are retrieved
I am using the JMSAdmin tool (both the GUI and the command line) to play around with building TopicConnectionFactories and Topics.
1. How / why do you choose between a Connection Consumer (used for the first 2 object types) versus a Subscriber (used for the second pair)?
2. If you pick one, what do you put for the value for the other when building the object? XXXXXXX? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 17, 2007 12:28 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'd guess that you use the ConnectionConsumer for MDBs and the Subscriber for non-MDB JMS Subscribers.
I'd suspect that you can set them both to the same thing, and not worry what the application is using. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Jul 17, 2007 1:37 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
OK.
Annoying that all 4 have to start with SYSTEM.JMS. (Yeah, I guess I could use Aliases).
So what's the deal with Durable versus non-Durable? BROKERCCSUBQ and BROKERSUBQ are attributes of a TCF, while BROKERCCDURSUBQ and BROKERDURSUBQ are attributes of a Topic.
If you are going to use durable subscribers, what do I code for the TCF's BROKERCCSUBQ and BROKERSUBQ? Does it not matter and its up to the app to ignore those 2 parms in the TCF and instead use one of the 2 on the Topic? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 17, 2007 2:13 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm hoping FJ will come along any moment now...
I haven't really worked with this stuff.  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 18, 2007 2:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
PeterPotkay wrote: |
OK.
Annoying that all 4 have to start with SYSTEM.JMS. (Yeah, I guess I could use Aliases).
So what's the deal with Durable versus non-Durable? BROKERCCSUBQ and BROKERSUBQ are attributes of a TCF, while BROKERCCDURSUBQ and BROKERDURSUBQ are attributes of a Topic. |
The Topic used to publish/subscribe contains here as attributes values for the default queues handling the topic's publication/subscription. The values given to the TCF are defaults. In case of durability for the topic the tcf defaults might not be adequate and the topic defaults will then allow you to override... That's my understanding of it.
PeterPotkay wrote: |
If you are going to use durable subscribers, what do I code for the TCF's BROKERCCSUBQ and BROKERSUBQ? Does it not matter and its up to the app to ignore those 2 parms in the TCF and instead use one of the 2 on the Topic? |
Yep I think so.
Please note as well that as a subscriber you are using the topic object to notify the broker where to put your durable subscription upon registration of your durable subscription. (Yes the queue has to start with SYSTEM.JMS.* but an alias will do fine).
You can then either receive the message from the Topic, or use a p2p connection to the queue and receive the message. (You will find that once read (get or browse) JMS will tell you that the message's destination is in fact a topic, and does not care whether you had used a tcf or a qcf....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 18, 2007 3:11 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fjb_saper wrote: |
JMS will tell you that the message's destination is in fact a topic, and does not care whether you had used a tcf or a qcf.... |
In JMS 1.1, that is. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 18, 2007 3:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
fjb_saper wrote: |
JMS will tell you that the message's destination is in fact a topic, and does not care whether you had used a tcf or a qcf.... |
In JMS 1.1, that is. |
Didn't check it for JMS 1.1 but the detail of my test was that it responded to instanceof Topic even though I was using a qcf.
if (mydest instanceof Topic)
elseif (mydest instanceof Queue)
endif _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Jul 18, 2007 3:19 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'd thought that in JMS 1.0, you had to use QueueDestination or TopicDestination explicitly. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 18, 2007 3:57 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
I'd thought that in JMS 1.0, you had to use QueueDestination or TopicDestination explicitly. |
You still retrieve a Destination. However in order to look at anything you need to cast to either Queue or Topic.
This is where the instanceof comes in handy to avoid the ClassCastException...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|