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 Java / JMS » Subscriber versus Consumer

Post new topic  Reply to topic
 Subscriber versus Consumer « View previous topic :: View next topic » 
Author Message
PeterPotkay
PostPosted: Tue Jul 17, 2007 12:09 pm    Post subject: Subscriber versus Consumer Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 17, 2007 12:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Tue Jul 17, 2007 1:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Jul 17, 2007 2:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 18, 2007 2:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Jul 18, 2007 3:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 18, 2007 3:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Jul 18, 2007 3:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Jul 18, 2007 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Subscriber versus Consumer
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.