[ 
https://issues.apache.org/jira/browse/OPENEJB-851?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dain Sundstrom closed OPENEJB-851.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.1

> ActiveMQResourceAdapter: ActiveMQ Embedded broker always started even if 
> BrokerXmlConfig is empty
> -------------------------------------------------------------------------------------------------
>
>                 Key: OPENEJB-851
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-851
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: container system
>    Affects Versions: 3.0.1
>         Environment: XP
>            Reporter: Jean-Louis MONTEIRO
>             Fix For: 3.0.1
>
>
> Using Embedded ActiveMQBroker works fine.
> But, I'm facing a problem to connect to a remote broker using the JMS 
> Resource Adapter (ActiveMQResourceAdapter).
> As far as I have understood, the configuration should be:
> <Resource id="My JMS Resource Adapter" type="ActiveMQResourceAdapter">
>   # Broker configuration URI as defined by ActiveMQ
>   # see http://activemq.apache.org/broker-configuration-uri.html
>   #BrokerXmlConfig broker:(tcp://localhost:61616)?useJmx=false
>   BrokerXmlConfig
>   
>   # Broker address
>   #ServerUrl vm://localhost?async=true
>   ServerUrl tcp://<target IP address>:61616
>   # DataSource for persistence messages
>   DataSource My Unmanaged DataSource
> </Resource>
> But, before delegating to the super class (ActiveMQ), openejb adds a 
> "openejb:" prefix to the empty URI.
> Looking to the super class 
> (org.apache.activemq.ra.ActiveMQResourceAdapter.start()) helps me suggesting 
> a patch:
> Index: 
> D:/javatools/openEJB3/openejb3-src/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
> ===================================================================
> --- 
> D:/javatools/openEJB3/openejb3-src/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
>  (revision 674174)
> +++ 
> D:/javatools/openEJB3/openejb3-src/container/openejb-core/src/main/java/org/apache/openejb/resource/activemq/ActiveMQResourceAdapter.java
>  (working copy)
> @@ -115,7 +115,7 @@
>  
>          // prefix server uri with openejb: so our broker factory is used
>          String brokerXmlConfig = getBrokerXmlConfig();
> -        if (brokerXmlConfig != null) {
> +        if (brokerXmlConfig!=null && brokerXmlConfig.trim().length()>0 ) {
>              try {
>                  URISupport.CompositeData compositeData = 
> URISupport.parseComposite(new URI(brokerXmlConfig));
>                  compositeData.getParameters().put("persistent", "false");
> Best regards,
> Jean-Louis MONTEIRO

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to