activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Gomes (JIRA)" <j...@apache.org>
Subject [jira] Created: (AMQ-2203) Duplication of Camel routes in activemq.xml and applicationContext.xml for Camel web app.
Date Thu, 09 Apr 2009 19:06:34 GMT
Duplication of Camel routes in activemq.xml and applicationContext.xml for Camel web app.
-----------------------------------------------------------------------------------------

                 Key: AMQ-2203
                 URL: https://issues.apache.org/activemq/browse/AMQ-2203
             Project: ActiveMQ
          Issue Type: Bug
    Affects Versions: 5.3.0
            Reporter: Jim Gomes
             Fix For: 5.3.0


It appears that there are now duplicate configuration points for Camel routes.  In the *activemq.xml*
configuration file, the following configuration exists:


{noformat}
    <!--
    ** Lets deploy some Enterprise Integration Patterns inside the ActiveMQ Message Broker
    ** For more details see
    **
    ** http://activemq.apache.org/enterprise-integration-patterns.html
    -->
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">

        <!-- You can use a <package> element for each root package to search for
Java routes -->
        <package>org.foo.bar</package>

        <!-- You can use Spring XML syntax to define the routes here using the <route>
element -->
        <route>
            <from uri="activemq:example.A"/>
            <to uri="activemq:example.B"/>
        </route>
    </camelContext>

    <!--
    ** Lets configure some Camel endpoints
    **
    ** http://activemq.apache.org/camel/components.html
    -->

    <!-- configure the camel activemq component to use the current broker -->
    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
        <property name="connectionFactory">
          <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL" value="vm://localhost?create=false&amp;waitForStart=10000"
/>
            <property name="userName" value="${activemq.username}"/>
            <property name="password" value="${activemq.password}"/>
          </bean>
        </property>
    </bean>
{noformat}

This is duplicated in the *webapps\camel\WEB-INF\applicationContext.xml* file:

{noformat}
  <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="activemq:example.A"/>
        <to uri="activemq:example.B"/>
    </route>
  </camelContext>

  <!-- configure the camel activemq component to use the current broker -->
  <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
    <property name="exposeAllQueues" value="true"/>
      <property name="connectionFactory">
        <bean class="org.apache.activemq.ActiveMQConnectionFactory">
          <property name="brokerURL" value="vm://localhost?create=false&amp;waitForStart=10000"
/>
          <property name="userName" value="${activemq.username}"/>
          <property name="password" value="${activemq.password}"/>
        </bean>
      </property>
  </bean>
{noformat}

The net effect of this is that when the broker is launched, there will be two consumers routing
messages from example.A to example.B.  At best, this causes unnecessary overhead.  If a user
edits the *activemq.xml* file to remove the route information, they think they have removed
this camel route.  However, when the broker is restarted, the route still exists, only now
with a single consumer routing the messages.  To truly remove the route, the user must also
edit the *applicationContext.xml*.

If the configuration of Camel routes is now being handled in the *applicationContext.xml*
file, then the obsolete configuration should be removed from *activemq.xml* and documentation
should be updated.  In any case, the duplication of Camel routes in a default configuration
should be eliminated.

-- 
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