Saturday, January 24, 2015

JBoss7.1.1 JMS | JBoss AS 7.1.1 - JMS Configuration

This article summarizes the issues I encountered during migration of a JMS application
from JBoss 4.2.3 to 7.1.1.

Configure Messaging and Remoting Modules

Refer to this article: http://blog.avisi.nl/2012/10/10/configuring-camel-to-use-hornetq-in-jboss-as-7.

RMI Port

if you previously used something like jnp://localhost:1099/, you need change it to remote://localhost:4447.

Handle Exception: javax.security.sasl.SaslException: 

Authentication failed: all available authentication mechanisms failed.
You need to add a user under Application Realm or remove the authentication by removing security-realm="ApplicationRealm" from
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
           <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
</subsystem>
in your standalone.xml.

Handle Exception: javax.jms.JMSSecurityException

Unable to validate user: null
You need to set "security-enabled" to false in the standalone.xml.
<subsystem xmlns="urn:jboss:domain:messaging:1.1">
     <hornetq-server>
         <security-enabled>false</security-enabled>
         ......
     </hornetq-server>
</subsystem>

Add System Properties

System properties can be added into standalone.xml.
<server>
<extensions>
</extensions>
<system-properties>
     <property name="propertyName" value="property value"/>
</system-properties>
</server>

Then, in your program, you can retrieve them using System.getProperty("propertyName").

Create JmsTemplate for Topics

<bean id="jmsTopicTemplate" class="org.springframework.jms.core.JmsTemplate">
   <constructor-arg ref="connectionFactory" />
   <property name="pubSubDomain" value="true"/>
</bean>

Summary of Dependent Libs

hornetq-core-2.2.13.Final.jar
hornetq-jms-2.2.13.Final.jar
jboss-remote-naming-1.0.2.Final.jar
netty-3.2.6.Final.jar
spreing-jms-3.2.5.RELEASE.jar

Check more details here.


Create a Successful Online Store at Bigcommerce! Try it Free Now!

No comments:

Post a Comment