What is the correct way to make a durable subscription?
You must set the client id and the subscription name
Programmatically, you can do it like this:
topicConnection.setClientID("MyClientID"); topicSession.createDurableSubscriber(topic, "MySubscriptionName");
Or you can configure it in conf/jbossmq-state.xml
<StateManager> <Users> <User> <Name>john</Name> <Password>needle</Password> <Id>MyClientID</Id> </User> </Users> <DurableSubscriptions> <DurableSubscription> <ClientID>MyClientID</ClientID> <Name>MySubscriptionName</Name> <TopicName>MyTopic</TopicName> </DurableSubscription> </DurableSubscriptions> </StateManager>
MDBs
For MDBs you need to configure the
mdb-client-id
and
mdb-subscription-id
described in the MDB config page or the
clientID
and
subscriptionName
if you are using the new activation-config-property mechanism introduced in EJB2.1
Comments