You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by bwarren <br...@usairways.com> on 2009/04/09 04:50:19 UTC

ActiveMQ / JBoss integration behaving badly?

I am running ActiveMQ with JBoss and seeing my JMS connections getting closed
when they shouldn't be by the JBoss CachedConnectionManager.  I've posted on
the JBoss forum here:

http://www.jboss.org/index.html?module=bb&op=viewtopic&t=153782

I suspect this is a JCA configuration issue or JBoss is being a little too
aggressive with cleanup.  Anyone seen this or can confirm that it's not a
resource adapter config issue?  I can send broker-config and
activemq-jms-ds.
-- 
View this message in context: http://www.nabble.com/ActiveMQ---JBoss-integration-behaving-badly--tp22963605p22963605.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ / JBoss integration behaving badly?

Posted by bwarren <br...@usairways.com>.
The environment was at the bottom of the JBoss forum post:

JBoss 5.0.1.GA
ActiveMQ 5.2.0

We've got ActiveMQ embedded in JBoss.

Contents of activemq-jms-ds.xml:
*****************************************************************
<connection-factories>

  <tx-connection-factory>
    <jndi-name>activemq/QueueConnectionFactory</jndi-name>
    <xa-transaction/>
    <track-connection-by-tx/>
    <rar-name>activemq-rar.rar</rar-name>
   
<connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
    <ServerUrl>vm://localhost</ServerUrl>
    <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.rar</rar-name>
   
<connection-definition>javax.jms.TopicConnectionFactory</connection-definition>
    <ServerUrl>vm://localhost</ServerUrl>
    <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=taskTopic">
    <attribute name="JNDIName">activemq/topic/task</attribute>
    <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar.rar'</depends>
    <attribute name="Type">javax.jms.Topic</attribute>
    <attribute name="Properties">PhysicalName=topic.task</attribute>
  </mbean>

  <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.topic:name=scanTopic">
    <attribute name="JNDIName">activemq/topic/scan</attribute>
    <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar.rar'</depends>
    <attribute name="Type">javax.jms.Topic</attribute>
    <attribute name="Properties">PhysicalName=topic.scan</attribute>
  </mbean>

  <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.topic:name=scannerTopic">
    <attribute name="JNDIName">activemq/topic/scanner</attribute>
    <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar.rar'</depends>
    <attribute name="Type">javax.jms.Topic</attribute>
    <attribute name="Properties">PhysicalName=topic.scanner</attribute>
  </mbean>

  <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.queue:name=fosQueue">
    <attribute name="JNDIName">activemq/queue/FOS</attribute>
    <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar.rar'</depends>
    <attribute name="Type">javax.jms.Queue</attribute>
    <attribute name="Properties">PhysicalName=queue.FOS</attribute>
  </mbean>

  <mbean code="org.jboss.resource.deployment.AdminObject"
name="activemq.topic:name=fosTopic">
    <attribute name="JNDIName">activemq/topic/FOS</attribute>
    <depends
optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-rar.rar'</depends>
    <attribute name="Type">javax.jms.Topic</attribute>
    <attribute name="Properties">PhysicalName=topic.FOS</attribute>
  </mbean>
</connection-factories>
*********************************************************************

Contents of broker-config.xml in the rar dir
*********************************************************************
<beans xmlns="http://activemq.apache.org/schema/core">

  <bean xmlns=""
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  <bean xmlns="" id="fosRemoteFactory"
class="com.ibm.mq.jms.MQQueueConnectionFactory">
    <property name="transportType" value="1" />
    <property name="hostName" value="MQHostName" /> 
    <property name="port" value="1415" />
    <property name="queueManager" value="queueManagerName" />
    <property name="channel" value="channelName" />
  </bean>

  <broker useJmx="true" brokerName="jboss-activemq-broker">

    <managementContext>
      <managementContext createConnector="false"/>
    </managementContext>

    <destinationPolicy>
      <policyMap>
        <policyEntries>

          <policyEntry topic="FOO.>">
            <dispatchPolicy>
              <strictOrderDispatchPolicy />
            </dispatchPolicy>
            <subscriptionRecoveryPolicy>
              <lastImageSubscriptionRecoveryPolicy />
            </subscriptionRecoveryPolicy>
          </policyEntry>

        </policyEntries>
      </policyMap>
    </destinationPolicy>


    <persistenceAdapter>
      <journaledJDBC journalLogFiles="5"
dataDirectory="${jboss.server.data.dir}/activemq"/>
    </persistenceAdapter>

    <transportConnectors>
      <transportConnector name="jboss-activemq-broker"
uri="stomp://localhost:61613?trace=true"/>
    </transportConnectors>

    <networkConnectors>
    </networkConnectors>

    <jmsBridgeConnectors>
      <jmsQueueConnector outboundQueueConnectionFactory="#fosRemoteFactory">
        <inboundQueueBridges>
          <inboundQueueBridge inboundQueueName="myInboundQueueName"
localQueueName="FOS" />
        </inboundQueueBridges>
      </jmsQueueConnector>
    </jmsBridgeConnectors>
  </broker>
</beans>
****************************************************************

Contents of ra.xml
****************************************************************
<connector xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
    version="1.5">
    <description>ActiveMQ  inbound and outbound JMS
ResourceAdapter</description>
    <display-name>ActiveMQ JMS Resource Adapter</display-name>
    <vendor-name>activemq.org</vendor-name>
    <eis-type>JMS 1.1</eis-type>
    <resourceadapter-version>1.0</resourceadapter-version>
    <license>
        <description>
          ...
        </description>
        <license-required>true</license-required>
    </license>
    <resourceadapter>
       
<resourceadapter-class>org.apache.activemq.ra.ActiveMQResourceAdapter</resourceadapter-class>
        <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><![CDATA[vm://localhost?create=false&async=false]]></config-property-value>
        </config-property>
        <config-property>
            <description>The default user name that will be used to
establish connections to the ActiveMQ server.</description>
            <config-property-name>UserName</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value>defaultUser</config-property-value>
        </config-property>
        <config-property>
            <description>The default password that will be used to log the
default user into the ActiveMQ server.</description>
            <config-property-name>Password</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
            <config-property-value>defaultPassword</config-property-value>
        </config-property>
        <config-property>
            <description>The client id that will be set on the connection
that is established to the ActiveMQ server.</description>
            <config-property-name>Clientid</config-property-name>
            <config-property-type>java.lang.String</config-property-type>
        </config-property>
        <config-property>
            <description>Boolean to configure if outbound connections should
reuse the inbound connection's session for sending messages.</description>
            <config-property-name>UseInboundSession</config-property-name>
            <config-property-type>java.lang.Boolean</config-property-type>
            <config-property-value>false</config-property-value>
        </config-property>

        <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>
           
<config-property-value>xbean:broker-config.xml</config-property-value>
        </config-property>

        <outbound-resourceadapter>
            <connection-definition>
               
<managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
               
<connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
               
<connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
               
<connection-interface>javax.jms.Connection</connection-interface>
               
<connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
            </connection-definition>
            <connection-definition>
               
<managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
               
<connectionfactory-interface>javax.jms.QueueConnectionFactory</connectionfactory-interface>
               
<connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
               
<connection-interface>javax.jms.QueueConnection</connection-interface>
               
<connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
            </connection-definition>
            <connection-definition>
               
<managedconnectionfactory-class>org.apache.activemq.ra.ActiveMQManagedConnectionFactory</managedconnectionfactory-class>
               
<connectionfactory-interface>javax.jms.TopicConnectionFactory</connectionfactory-interface>
               
<connectionfactory-impl-class>org.apache.activemq.ra.ActiveMQConnectionFactory</connectionfactory-impl-class>
               
<connection-interface>javax.jms.TopicConnection</connection-interface>
               
<connection-impl-class>org.apache.activemq.ra.ManagedConnectionProxy</connection-impl-class>
            </connection-definition>
            <transaction-support>XATransaction</transaction-support>
            <authentication-mechanism>
               
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
               
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
            </authentication-mechanism>
            <reauthentication-support>false</reauthentication-support>
        </outbound-resourceadapter>
        <inbound-resourceadapter>
            <messageadapter>
                <messagelistener>
                   
<messagelistener-type>javax.jms.MessageListener</messagelistener-type>
                    <activationspec>
                       
<activationspec-class>org.apache.activemq.ra.ActiveMQActivationSpec</activationspec-class>
                        
                        <required-config-property>
                           
<config-property-name>destination</config-property-name>
                        </required-config-property>
                        <required-config-property>
                           
<config-property-name>destinationType</config-property-name>
                        </required-config-property>
                        
                    </activationspec>
                </messagelistener>
            </messageadapter>
        </inbound-resourceadapter>
        <adminobject>
            <adminobject-interface>javax.jms.Queue</adminobject-interface>
           
<adminobject-class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
            <config-property>
                <config-property-name>PhysicalName</config-property-name>
               
<config-property-type>java.lang.String</config-property-type>
            </config-property>
        </adminobject>
        <adminobject>
            <adminobject-interface>javax.jms.Topic</adminobject-interface>
           
<adminobject-class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
            <config-property>
                <config-property-name>PhysicalName</config-property-name>
               
<config-property-type>java.lang.String</config-property-type>
            </config-property>
        </adminobject>
    </resourceadapter>
</connector>
*************************************************************

Think it's the server url: async=false?  
vm://localhost?create=false&async=false

Sorry for the humongous post.  I tried to trim them down to the bare
essentials.


bsnyder wrote:
> 
> On Wed, Apr 8, 2009 at 8:50 PM, bwarren <br...@usairways.com> wrote:
>>
>> ...
>> http://www.jboss.org/index.html?module=bb&op=viewtopic&t=153782
>> ...
> 
> I've not seen this happen before. What version of ActiveMQ are you
> using? What version of JBoss are you using? Are you embedding ActiveMQ
> inside of JBoss or is ActiveMQ running stand alone? Please describe
> your scenario with more detail and send along the configs.
> 
> Bruce
> 

-- 
View this message in context: http://www.nabble.com/ActiveMQ---JBoss-integration-behaving-badly--tp22963605p22981378.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: ActiveMQ / JBoss integration behaving badly?

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Apr 8, 2009 at 8:50 PM, bwarren <br...@usairways.com> wrote:
>
> I am running ActiveMQ with JBoss and seeing my JMS connections getting closed
> when they shouldn't be by the JBoss CachedConnectionManager.  I've posted on
> the JBoss forum here:
>
> http://www.jboss.org/index.html?module=bb&op=viewtopic&t=153782
>
> I suspect this is a JCA configuration issue or JBoss is being a little too
> aggressive with cleanup.  Anyone seen this or can confirm that it's not a
> resource adapter config issue?  I can send broker-config and
> activemq-jms-ds.

I've not seen this happen before. What version of ActiveMQ are you
using? What version of JBoss are you using? Are you embedding ActiveMQ
inside of JBoss or is ActiveMQ running stand alone? Please describe
your scenario with more detail and send along the configs.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder