jboss和activemq的集成

http://activemq.apache.org/integrating-apache-activemq-with-jboss.html

如果需要将activemq从jboss中独立出来,补充以下操作

Development MDB in JBoss 6 with external ActiveMQ
For high performance environment, the JMS server should be a stand alone server. JBoss run as MDB container can be more than one. In this case, the ActiveMQ is not embedded in JBoss. JBoss must configured to connect external ActiveMQ server.

External ActiveMQ is similar to embedded ActiveMQ. Except following changes:

1.    In ra.xml
l    Modify ServerUrl property
<config-property>
       <description>
         The URL to the ActiveMQ server that you want this connection to connect to. If using
              an embedded broker, this value should be 'vm://localhost'.
       </description>
       <config-property-name>ServerUrl</config-property-name>
       <config-property-type>java.lang.String</config-property-type>
       <config-property-value>tcp://135.251.27.94:61616</config-property-value>
       <!--<config-property-value>vm://localhost</config-property-value> -->
   </config-property>
    The letter in RED is the external activemq’s ip and port.
l    Comment BrokerXmlConfig property
    <!-- NOTE disable the following property if you do not wish to deploy an embedded broker -->
    <!--
        <config-property>
            <description>
              Sets the XML configuration file used to configure the embedded ActiveMQ broker via
              Spring if using embedded mode.
             
              BrokerXmlConfig is the filename which is assumed to be on the classpath unless
              a URL is specified. So a value of foo/bar.xml would be assumed to be on the
              classpath whereas file:dir/file.xml would use the file system.
              Any valid URL string is supported.             
            </description>
            <config-property-name>BrokerXmlConfig</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
             To use the broker-config.xml from the root for the RAR
               <config-property-value>xbean:broker-config.xml</config-property-value>
             To use an external file or url location
               <config-property-value>xbean:file:///amq/config/jee/broker-config.xml</config-property-value>
            <config-property-value>xbean:broker-config.xml</config-property-value>
        </config-property>
-->

2.    In activemq-jms-ds.xml
Check content in <tx-connection-factory>, modify <ServerUrl> tag to tcp://135.251.27.94:61616
The letters in RED is the ActiveMQ’s IP and port.

猜你喜欢

转载自memorymyann.iteye.com/blog/1146496