tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Louis MONTEIRO (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENEJB-851) ActiveMQResourceAdapter: unable to connect to a remote broker
Date Mon, 07 Jul 2008 16:29:31 GMT
ActiveMQResourceAdapter: unable to connect to a remote broker
-------------------------------------------------------------

                 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


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.


Mime
View raw message