3 Replies Latest reply on Nov 28, 2014 4:50 AM by Jay SenSharma

    Convert jms-ds.xml to JBoss AS7

    valsaraj viswanathan Master

      Hi,

       

      We are using the following jms-ds.xml in JBoss 6:

      <connection-factories>

         <!--

          JMS Stuff

         -->

         <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="hornetq:service=JMSProviderLoader,name=JMSProvider">

            <attribute name="ProviderName">DefaultJMSProvider</attribute>

            <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>

            <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>

            <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>

            <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>

         </mbean>

         <!--

          JMS XA Resource adapter, use this to get transacted JMS in beans

         -->

         <tx-connection-factory>

            <jndi-name>JmsXA</jndi-name>

            <xa-transaction/>

            <rar-name>jms-ra.rar</rar-name>

            <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>

            <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>

            <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>

            <max-pool-size>20</max-pool-size>

            <security-domain-and-application>JmsXARealm</security-domain-and-application>

         </tx-connection-factory>

      </connection-factories>

       

      How can w emigrate this into Jboss AS7?

        • 1. Re: Convert jms-ds.xml to JBoss AS7
          Jay SenSharma Master

          In AS7 you will not find MBean based "JMSProviderLoader".  It by default uses HornetQ as messaging provider and all the connection factory related configurations can be found inside the "full"/"full-ha" profiles (by default contains) messaging subsystem.  So if you want to check the JNDI names of connection-factories and if you want to configure messaging destinations then you can define them inside the same messaging subsystem.

           

          You can also use the "* -jms.xml"  file But only for defining JMS destinations (Queues/Topics)

           

          Check:   Messaging configuration - JBoss AS 7.1 - Project Documentation Editor

          • 2. Re: Convert jms-ds.xml to JBoss AS7
            valsaraj viswanathan Master

            I have added the messaging related configurations from standalone-full.xml file to standalone.xml file. Then configured queues required by the application. But how can I use the security domain that we used before.

            <security-domain-and-application>JmsXARealm</security-domain-and-application>

            This JmsXARealm is also configured in boss:domain:security:1.1 section but how to point messaging sub system to use this security realm?

            • 3. Re: Re: Convert jms-ds.xml to JBoss AS7
              Jay SenSharma Master

              You can configure the security domain for your Messaging service using the <security-domain> tag inside the hornetq server tag or you can use your the CLI command to assign a security domain to your messaging server.

               

              By default we need to create users inside the ApplicationRealm (user with default role as "guest") in order to access messaging resources.

               

              [standalone@localhost:9999 /] /subsystem=messaging/hornetq-server=default:write-attribute(name=security-domain,value="YOUR_SECURITY_DOMAIN")
              

               

              Example:

               <subsystem xmlns="urn:jboss:domain:messaging:1.2">
                          <hornetq-server>
                              <persistence-enabled>true</persistence-enabled>
                              <security-domain>YOUR_SECURITY_DOMAIN</security-domain>
              

               

              Refer to thread :  Re: Setup custom JAAS login module in HornetQ with JBoss 7.1.1.Final        for more details on this.