• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to create DurableTopicSubscriptions in JBoss 5

 
Ranch Hand
Posts: 128
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
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.

thanks in advance,
uttam
 
uttam kumar
Ranch Hand
Posts: 128
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what I have found so far is that we have to create users and their roles in mssql-persistence-service.xml through sql query in




but is this a feasible way? suppose if there is a huge number of users then what should we do?
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to do the following:

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.
 
uttam kumar
Ranch Hand
Posts: 128
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Peter,
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.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
uttam kumar
Ranch Hand
Posts: 128
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
thanks for your quick reply. I am using EJB2 so could you please tell me now what I have to do for durable topic subscription?
 
uttam kumar
Ranch Hand
Posts: 128
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
I have created users and their roles using xxx-persistance-service.xml, but when client tries to access any topic/queue I get following error on the JBoss console

is there something missed by me ?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic