Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Durable Subscriptions with MDBs

Reply
Thread Tools

Durable Subscriptions with MDBs

 
 
GCampolo
Guest
Posts: n/a
 
      10-04-2004
Hi all!

I asked this question already a couple of weeks ago in the Sun forums
but got no reply...I hope that someone can help me there...

I have set up one TopicConnectionFactory and one Topic. A component
sends a JMS message to the JMS server.
Several message driven beans are listening on the same topic but they
all have a different Message Selector,
so depending on that the messages are consumed by the respective MDB.
This does work perfectly fine, but now
I want the MDBs to be durable subscribers for the topic. I thought it
would be possible to set the 'Durable
Subscription' option in deploy tool with each MDB having another
Subscription name. Additionally I added the
property (ClientId, MyID) to the TopicConnectionFactory in the JMS
settings for the AppServer. But if I have
more than one MDB an exception is thrown during deployment, if I only
deploy one MDB it does work.

So now, my question is: is it possible at all to have more than one
durable subscribers for only
TopicConnectionFactory and Topic or not? And if it would be possible
what am I doing wrong? How can
else solve my problem?

Thanks in advance
 
Reply With Quote
 
 
 
 
David Hilsee
Guest
Posts: n/a
 
      10-05-2004
"GCampolo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi all!
>
> I asked this question already a couple of weeks ago in the Sun forums
> but got no reply...I hope that someone can help me there...
>
> I have set up one TopicConnectionFactory and one Topic. A component
> sends a JMS message to the JMS server.
> Several message driven beans are listening on the same topic but they
> all have a different Message Selector,
> so depending on that the messages are consumed by the respective MDB.
> This does work perfectly fine, but now
> I want the MDBs to be durable subscribers for the topic. I thought it
> would be possible to set the 'Durable
> Subscription' option in deploy tool with each MDB having another
> Subscription name. Additionally I added the
> property (ClientId, MyID) to the TopicConnectionFactory in the JMS
> settings for the AppServer. But if I have
> more than one MDB an exception is thrown during deployment, if I only
> deploy one MDB it does work.
>
> So now, my question is: is it possible at all to have more than one
> durable subscribers for only
> TopicConnectionFactory and Topic or not? And if it would be possible
> what am I doing wrong? How can
> else solve my problem?


My instinct tells me that each of your MDBs is durably subscribing using the
same client ID but different connections, which may be giving your JMS
provider fits. From the J2EE javadocs for
javax.jms.Connection.setClientID():

"If another connection with the same clientID is already running when this
method is called, the JMS provider should detect the duplicate ID and throw
an InvalidClientIDException."

Have you tried using a different TopicConnectionFactory for each MDB? If
this isn't the problem, then stack trace or some other more detailed
explanation of the problem may help.

--
David Hilsee


 
Reply With Quote
 
 
 
 
David Hilsee
Guest
Posts: n/a
 
      10-05-2004
"David Hilsee" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
<snip>
> My instinct tells me that each of your MDBs is durably subscribing using

the
> same client ID but different connections, which may be giving your JMS
> provider fits. From the J2EE javadocs for
> javax.jms.Connection.setClientID():
>
> "If another connection with the same clientID is already running when this
> method is called, the JMS provider should detect the duplicate ID and

throw
> an InvalidClientIDException."
>
> Have you tried using a different TopicConnectionFactory for each MDB? If
> this isn't the problem, then stack trace or some other more detailed
> explanation of the problem may help.


To be 100% clear, I mean different TopicConnectionFactories, each with a
unique client ID. So, for example, one MDB would have a TCF with a client
ID of "MDB1", the next would have a TCF with a client ID of "MDB2", etc.

--
David Hilsee


 
Reply With Quote
 
GCampolo
Guest
Posts: n/a
 
      10-05-2004
"David Hilsee" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> To be 100% clear, I mean different TopicConnectionFactories, each

with a
> unique client ID. So, for example, one MDB would have a TCF with a client
> ID of "MDB1", the next would have a TCF with a client ID of "MDB2", etc.


Yes, I tried it with different TopicConnectionFactories and this did
work. What I wanted to know was if this is the only way to do it. From
what I read until now it really seems that for each "Durable MDB" one
seperate TCF has to be set up. I thought that maybe the option
"SubscriptionName" in deploytool from the SUN application server would
allow to register more than durable subscriber to one TCF.
 
Reply With Quote
 
David Hilsee
Guest
Posts: n/a
 
      10-05-2004
"GCampolo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> "David Hilsee" <(E-Mail Removed)> wrote in message

news:<(E-Mail Removed)>...
> > To be 100% clear, I mean different TopicConnectionFactories, each

> with a
> > unique client ID. So, for example, one MDB would have a TCF with a

client
> > ID of "MDB1", the next would have a TCF with a client ID of "MDB2", etc.

>
> Yes, I tried it with different TopicConnectionFactories and this did
> work. What I wanted to know was if this is the only way to do it. From
> what I read until now it really seems that for each "Durable MDB" one
> seperate TCF has to be set up. I thought that maybe the option
> "SubscriptionName" in deploytool from the SUN application server would
> allow to register more than durable subscriber to one TCF.


The subscription name is different from the client ID, and changing it
shouldn't affect your problem. From what I can tell, the problem is that
the application server is establishing a connection for each MDB, and each
connection has the same client ID, which is not allowed. I don't use Sun's
application server, so I don't have an answer for this. It seems to me that
you want to find a way for all three MDBs to share the same connection to
the JMS provider, and I wouldn't know how to do that using that product.
Heck, I don't think I know if it's possible the application server I'm
currently using.

--
David Hilsee


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions - JMS Durable Topics and Subscriptions Jazil Java 2 06-15-2008 08:05 AM
How durable are solid state readers/writers? Mike Henley Digital Photography 7 04-03-2006 02:12 AM
Are DVD-Rs more Durable then CD-Rs? Scratches lbbss Computer Support 3 03-30-2005 03:31 PM
I need a pattern for Securing MDBs meaneyedcat@hotmail.com Java 0 03-09-2005 04:11 PM
What media card format is most durable/reliable? Mike Henley Digital Photography 3 07-23-2004 12:43 PM



Advertisments