-
1. Re: unwanted MDB subscriptions to a topic
leosbitto May 4, 2010 3:57 AM (in response to dbschofield)I am not sure that I understand your situation correctly, but perhaps you want to use JMS Queue instead of JMS Topic.
-
2. Re: unwanted MDB subscriptions to a topic
timfox May 4, 2010 4:27 AM (in response to leosbitto)I believe this was a bug in JCA that was fixed some time back.
Try TRUNK
-
3. Re: unwanted MDB subscriptions to a topic
timfox May 4, 2010 4:28 AM (in response to timfox)Ah sorry, too quick to answer.
Yes, I think Leos is right. The whole point of a topic is the message goes to every subscriber.
If you want each message to be consumed by just one subscriber, use a queue, or have all MDBs subscribe to the same durable subscription on the topic.
-
4. Re: unwanted MDB subscriptions to a topic
leosbitto May 4, 2010 5:54 AM (in response to timfox)Tim Fox wrote:
That would work only if the MDB pool size would be 1: http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Session.html#createDurableSubscriber%28javax.jms.Topic,%20java.lang.String%29 - "Only one session at a time can have a
TopicSubscriber
for a particular durable subscription." -
5. Re: unwanted MDB subscriptions to a topic
timfox May 4, 2010 6:01 AM (in response to leosbitto)Leos Bitto wrote:
Tim Fox wrote:
That would work only if the MDB pool size would be 1: http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Session.html#createDurableSubscriber%28javax.jms.Topic,%20java.lang.String%29 - "Only one session at a time can have a
TopicSubscriber
for a particular durable subscription."That only applies if you're using the raw JMS api.
In JEE it's perfectly fine to have many topic subscribers on the same durable sub - in this way processing work load can be balanced across multiple users.
There's no 1-1 mapping between the MDB instance and a JMS session.
-
6. Re: unwanted MDB subscriptions to a topic
leosbitto May 4, 2010 8:40 AM (in response to timfox)Tim Fox wrote:
Leos Bitto wrote:
Tim Fox wrote:
That would work only if the MDB pool size would be 1: http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Session.html#createDurableSubscriber%28javax.jms.Topic,%20java.lang.String%29 - "Only one session at a time can have a
TopicSubscriber
for a particular durable subscription."That only applies if you're using the raw JMS api.
In JEE it's perfectly fine to have many topic subscribers on the same durable sub - in this way processing work load can be balanced across multiple users.
There's no 1-1 mapping between the MDB instance and a JMS session.
Sure, I was too focused on the synchronous processing. Because MDB has to implement the javax.jms.MessageListener interface, the onMessage() methods of multiple MDB's should not get executed concurrently and so no problems with inappropriate sharing of a durable topic subscription should occur.
-
7. Re: unwanted MDB subscriptions to a topic
dbschofield May 6, 2010 12:27 PM (in response to timfox)Tim, you were right about the bug in the JCA adaptor. I upgraded the adaptor to 2.1 beta 3. Now I have one subscription instead of 15