as in jboss 3.x the jms provider was jbossmq and we define the DurableTopicSubscriptions in the file conf/jbossmq-state.xml;
if i want to do the same in JBoss AS5 what should I do?
i also want to create users that can access the topics, what should i do ?
i am using mssql for jms persistance.
In the topic descriptor (*-service.xml) you need to grant create access to the roles that will connect to durable topic.
You also need to create users for those roles. For the above example, users for the "vcust" role.
Then in the code, you need to provide the username/password when connecting to the topic, and you need to indicate that you want a durable subscription by calling Session.createDurableSubscriber (not sure if you need this, my code seems to work without it)
JBoss in Action has a an example. If you get the source code, first read jbia-src/index.html, then in jbia-src/ch08 you can run ant target 05.
that is what i want to know. i am migrating from JBoss 3.2 to JBoss 5.0.GA; and there we have defined more than 250 users with different roles and access to topics and queues in jbossmq-state.xml. I want to know is there any any way like jbossmq-state.xml where we can define these things ? without making changes in the previous code.
Loading your users and roles into the table is one issue, and I think I addressed this in your other post.
As far as my question of my use of createDurableSubscriber, or lack thereof, I did plan to try out my example again and get back to you. But it will have to wait a while - I'm on my way to the dentist.
Looks like my example JMS client lost it's durability. So my instructions are correct, you must use Session.createDurableSubscriber() to establish durability. Within an EJB3 MDB, you can add this annotation like this:
Each call to Session.createDurableSubscriber() take a 'name' parameter. This name cannot be the same for two clients - if it is you get the error that you posted. The messaging server uses this name to track who has and who has not yet received a message published to a topic.