9 Replies Latest reply on Feb 17, 2008 3:00 PM by timfox

    JBoss Messaging RA configuration

      Hi Everybody

      I have been playing with JBoss Messaging for a few days and want to achieve something which i cannot get to work:

      The idea is the following:

      Have a JBoss Appserver procuce message to a clustered JBoss Mesaging implementation via JCA RA adapter connected to teh remote cluster. I would like to achieve this without a local JBoss Messaging Instance in the appserver. The JCA access here is not required but would be nice to have because the consumer side should work this way.
      On the consumer side i wuold like to have an EJB3 MDB agin connected via a JCA resource adapter to the cluster. (again preferrably without the local Jboss Messaging service, only libs)

      I have been experimenting with extending the Local JNDI with part of the remote JNDI tree to get access to the remote queue
      I also tested setting up a XA Connection to the remote cluster but then i got stuck trying to make a remote queue into in administered object. I don't know what properties this admin object would accept.
      There are plenty of examples how to get this done with ActiveMq, WebsphereMQ but nothing with Jboss Messaging.

      I would like to know if there is any change of success in this scenario.


      Thnx
      Karl de Boer

        • 1. Re: JBoss Messaging RA configuration

          I am using JBoss 4.2.2GA and JBoss Message 1.4.SP3

          • 2. Re: JBoss Messaging RA configuration
            ataylor

            Could you clarify please? Are you saying you want to run messaging JBM clients without having to run a JBM server? This is not possible with JBM1.4!

            • 3. Re: JBoss Messaging RA configuration

              Hi,

              No i wanted to implement a JBoss messaging client talking to a JBM clustered server without installing a Jboss Messaging implementation on the server (just throwing jboss-messaging.jar in the lib dir).
              But I solved this part using remote JNDI lookup on the cluster. What is not mentioned in the documentation is that you need in fact also libs from the cluster configuration (the all configuration) in a non clustered JBoss Appserver (the message producer). At least jbossha.jar.
              Perhaps it was a bad idea to do this with JCA.
              But for the consumer side i would like to set up a JBoss RA configuration to the remote cluster to be used in an EJB3 MDB. Is this posssible. I know it is possible to configure a remote connection factory. But how can i configure the remote queue as administered object just like the examples on JBoss ActiveMQ and JBoss WebsphereMQ examples. I assume this is needed.
              Thanks for the quick reply



              • 4. Re: JBoss Messaging RA configuration
                ataylor

                 

                No i wanted to implement a JBoss messaging client talking to a JBM clustered server without installing a Jboss Messaging implementation on the server (just throwing jboss-messaging.jar in the lib dir).

                JBM must be installed and configured on the server.
                But I solved this part using remote JNDI lookup on the cluster. What is not mentioned in the documentation is that you need in fact also libs from the cluster configuration (the all configuration) in a non clustered JBoss Appserver (the message producer). At least jbossha.jar.
                Perhaps it was a bad idea to do this with JCA.

                I'm still a little unclear as to what you are doing here. Are you looking up the connection factory, if this is the case then JBM must be installed.
                But how can i configure the remote queue as administered object just like the examples on JBoss ActiveMQ and JBoss WebsphereMQ examples.

                Can you direct me at these examples and maybe i'll be able to grasp exactly what you are trying to achieve.

                • 6. Re: JBoss Messaging RA configuration

                  Thanks for the link. I was aware of this wiki page.
                  But there is something unclear to me:
                  If you have a handle to a remote connectionFactory, how can you get a handle to a queue running in a remote server. Is this automatically done in the correct JNDI namespace (the remote server one) or are other tricks needed. That is why i thought about some admin object referencing a remote queue.

                  The inspiration (or confusement) comes from the way JBoss integrates with ActiveMQ.
                  Her is a sample of a connection factory and an admin object for the remote queue:




                  <?xml version="1.0" encoding="UTF-8"?>
                  <connection-factories>
                  <tx-connection-factory>
                  <jndi-name>activemq/QueueConnectionFactory</jndi-name>
                  <xa-transaction/>
                  <track-connection-by-tx/>
                  <rar-name>activemq-rar-5.1.0.rar</rar-name>
                  <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
                  <ServerUrl>tcp://messagebroker1:61616</ServerUrl>
                  <!--
                  <UserName>sa</UserName>
                  <Password></Password>
                  -->
                  <min-pool-size>1</min-pool-size>
                  <max-pool-size>200</max-pool-size>
                  <blocking-timeout-millis>30000</blocking-timeout-millis>
                  <idle-timeout-minutes>3</idle-timeout-minutes>
                  </tx-connection-factory>
                  <tx-connection-factory>
                  <jndi-name>activemq/TopicConnectionFactory</jndi-name>
                  <xa-transaction/>
                  <track-connection-by-tx/>
                  <rar-name>activemq-rar-5.1.0.rar</rar-name>
                  <connection-definition>javax.jms.TopicConnectionFactory</connection-definition>
                  <ServerUrl>tcp://messagebroker1:61616</ServerUrl>
                  <!--
                  <UserName>sa</UserName>
                  <Password></Password>
                  -->
                  <min-pool-size>1</min-pool-size>
                  <max-pool-size>200</max-pool-size>
                  <blocking-timeout-millis>30000</blocking-timeout-millis>
                  <idle-timeout-minutes>3</idle-timeout-minutes>
                  </tx-connection-factory>
                  <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.topic:name=inboundTopic">
                  <attribute name="JNDIName">queue/receiver</attribute>
                  <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar-5.1.0.rar'</depends>

                  <attribute name="Type">javax.jms.Queue</attribute>
                  <attribute name="Properties">PhysicalName=queue.receiver</attribute>
                  </mbean>
                  </connection-factories>




                  BTW After doing several tests with ActiveMQ and JBoss Messaging (with clustering and persistency) i chose for Jboss Messaging.

                  • 7. Re: JBoss Messaging RA configuration
                    timfox

                     

                    "kdeboer" wrote:
                    Thanks for the link. I was aware of this wiki page.
                    But there is something unclear to me:
                    If you have a handle to a remote connectionFactory, how can you get a handle to a queue running in a remote server. Is this automatically done in the correct JNDI namespace (the remote server one) or are other tricks needed.


                    You can either use a resource-ref to reference the remote queue or create an initial context using the remote provider jndi properties, see:

                    http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMQHAOverview for some examples.

                    E.g.


                    <resource-ref>
                    <res-ref-name>jms/Queue</res-ref-name>
                    <jndi-name>jnp://myremoteserver:1099/queue/A</jndi-name>
                    </resource-ref>




                    • 8. Re: JBoss Messaging RA configuration

                      I am using an EJB3 MessageDrivenBean using the activation-config property
                      destination and destinationType

                      Can the destination be reconfigured as a resource reference in jboss.xml deployment descriptor? This is more an EJB3 question, but perhaps you know. Or should i use a different strategy to configure an MDB to a remote queue.
                      Anyway it would be best to do this in an JCA RA type of configuration.

                      Thanks (again :-))
                      Karl

                      • 9. Re: JBoss Messaging RA configuration
                        timfox

                         

                        "kdeboer" wrote:

                        Can the destination be reconfigured as a resource reference in jboss.xml deployment descriptor?


                        See my previous post.