JMS Security
Some topic and queues require the appropriate permissions to operate.
Topic and queue permissions can be set in </jboss-4.2.2.ga/server/messaging/deploy/jboss-messaging.sar/destinations-service.xml See in >
< Mbean code = "Org.jboss.jms.server.destination.TopicService"
Name = "Jboss.messaging.destination:service=topic,name=testtopic"
XMBEAN-DD = "Xmdesc/topic-xmbean.xml" >
< depends optional-attribute-name = "Serverpeer" > Jboss.messaging:service=serverpeer </depends >
< depends > Jboss.messaging:service=postoffice </depends >
< attribute name = "Securityconfig" >
< security >
< role name = "Guest" read = "true" Write = "true"/>
< role name = "Publisher" read = "true" Write = "true" Create = "false"/>
< role name = "Durpublisher" read = "true" Write = "true" Create = "true"/>
</Security >
</attribute >
</Mbean >
If security is not set, use </jboss-4.2.2.GA/server/messaging/deploy/jboss-messaging.sar/messaging-service.xml> The default setting in the.
< attribute name = "Defaultsecurityconfig" >
< security >
< role name = "Guest" read = "true" Write = "true" Create = "true"/>
</Security >
</attribute >
If you want to operate a security queue or topic, you can use spring's usercredentialsconnectionfactoryadapter. The settings in spring are as follows:
< Jee:jndi-lookup ID = "Jmsconnectionfactory" Lookup-on-startup = "false" Proxy-interface = " Javax.jms.ConnectionFactory "
Jndi-name = "ConnectionFactory" >
< jee:environment >
Java.naming.factory.initial=org.jnp.interfaces.namingcontextfactory
Java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099
</jee:environment >
</jee:jndi-lookup >
< Bean id = "Myconnectionfactory" class = " Org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter "
Lazy-init = "true" >
< property name = "Targetconnectionfactory" ref = "Jmsconnectionfactory"/>
< property name = "username" value = "Guest"/>
< property name = "Password" value = "Guest"/>
</Bean >
< Bean id = "Jmstemplate" Lazy-init = "true" class = "Org.springframework.jms.core.JmsTemplate" >
< property name = "ConnectionFactory" ref = "Myconnectionfactory"/>
< property name = "Defaultdestinationname" value = "A"/>
</Bean >