Thursday, September 22, 2011

Creating Durable Subscribers for a Distributed Topic

I need to run a stress test for a DT with >100 Durable Subscribers.

The Connection Factory to connect to the DT is registered in JNDI as a weblogic.jms.client.JMSConnectionFactory which implements javax.jms.QueueConnectionFactory AND javax.jms.TopicConnectionFactory (and some other interfaces)

A TopicConnectionFactory creates a TopicConnection,
which creates a TopicSession, which creates a Durable Subscriber identified with a name. This Durable Subscriber is a TopicSubscriber.

A TopicSubscriber is a MessageConsumer

Funnily enough, with WebLogic console you can examine only Durable Subscribers to a Distributed Topic is you are in a standalone server, but if you are in a cluster this Monitoring page is not available. You must write a WLST script for that.

Now, pay attention to this: when you create a Distributed Topic, with JNDI name "BLA", and you target it to 2 members, say JMSServer1 and JMSServer2, you get 2 different kind of entries in JNDI tree:

BLA = weblogic.jms.common.DistributedDestinationImpl

JMSServer1@BLA = weblogic.jms.common.DestinationImpl
JMSServer2@BLA = weblogic.jms.common.DestinationImpl

Be aware that YOU CANNOT CREATE A DURABLE SUBSCRIBER to a DistributedDestinationImpl, it must be a DestinationImpl.
So, lookup JMSServer1@BLA in JNDI, and not BLA.

No comments: