This content has been marked as final.
Show 1 reply
-
1. Re: jbossmq-state.xml contains ClientIDs for same MDB
sschmidt Sep 16, 2005 4:13 PM (in response to pcarrollnf)I found navigating this site for an answer to this problem very frustrating and confusing, as much was contrdictory and it was often difficult to see which version of JBoss it applied to, but the answer I found was that you can specify the mdb-user and mdb-passwd tags in the jboss.xml file and to assign the value from the mdb-subscription-id tag to the users in jbossmq-state.xml. This way, the mdbs get deployed with a specific ID rather than a system assigned ID that might change on a restart.
from jboss.xml...<message-driven> <ejb-name>myMDB1</ejb-name> <destination-jndi-name>topic/MDBTopic</destination-jndi-name> <mdb-user>jane</mdb-user> <mdb-passwd>thread</mdb-passwd> <mdb-subscription-id>myMDB1</mdb-subscription-id> <configuration-name>Standard Message Driven Bean</configuration-name> <resource-ref> <res-ref-name>jms/TopicConnectionFactory</res-ref-name> <jndi-name>ConnectionFactory</jndi-name> </resource-ref> <resource-env-ref> <resource-env-ref-name>jms/MDBTopic</resource-env-ref-name> <jndi-name>topic/MDBTopic</jndi-name> </resource-env-ref> </message-driven>
from jbossmq-state.xml<User> <Name>jane</Name> <Password>thread</Password> <Id>myMDB1</Id> </User> </Users> <Roles> <Role name="guest"> <UserName>guest</UserName> <UserName>john</UserName> </Role> <Role name="subscriber"> <UserName>john</UserName> <UserName>jane</UserName> </Role> <Role name="publisher"> <UserName>john</UserName> <UserName>dynsub</UserName> </Role> <Role name="durpublisher"> <UserName>john</UserName> <UserName>dynsub</UserName> <UserName>jane</UserName> </Role>
The durable subscriptions get added to the file on deployment as:<DurableSubscriptions> <DurableSubscription> <ClientID>myMDB1</ClientID> <Name>myMDB1</Name> <TopicName>MDBTopic</TopicName> </DurableSubscription> <DurableSubscription> <ClientID>myMDB2</ClientID> <Name>myMDB2</Name> <TopicName>MDBTopic</TopicName> </DurableSubscription> </DurableSubscriptions>
myMDB2 was another one assigned to john.