Hi,

I've been using ActiveMQ for some time and now I'm trying to figure out how
to leverage EIP via Camel. However, being completely new to Java and coming
from a Perl background, I'm experiencing some difficulties even running the
basic samples included along with the binary distribution of ActiveMQ-5.0.0.

Therefore I'm seeking your help to understand few basic things:

- is Camel shipped with ActiveMQ? Looking at sample configuration, it seems
  so, but Camel binary distribution includes a lot more files; should Camel
  be downloaded and started separately? Would you be so kind to share an
  example of how you setup it?

- if Camel inside ActiveMQ works out-of-the-box, why is example found at

        http://activemq.apache.org/camel/message-router.html

  throwing a Null Pointer exception during startup?

- is there a comprehensive documentation about configuring EIP rules using
  XML? Can you point me to some online reference?

See below for more details about versions used and configuration file.

Thanks in advance,

        Valerio

--

software:

ActiveMQ: 5.0.0 binary distribution

Java: tried both Java version 1.5.0_13 and 1.6.0_03 under Kubuntu

configuration:

<beans
  xmlns="http://www.springframework.org/schema/beans";
  xmlns:amq="http://activemq.org/config/1.0";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="
    http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://activemq.org/config/1.0
      http://activemq.apache.org/schema/activemq-core.xsd
    http://activemq.apache.org/camel/schema/spring
      http://activemq.apache.org/camel/schema/spring/camel-spring.xsd";>

  <bean 
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
  
  <broker xmlns="http://activemq.org/config/1.0"; brokerName="localhost" 
dataDirectory="${activemq.base}/data">
    <destinations>
      <queue physicalName="dadanet.events.incoming" />
      <topic physicalName="dadanet.events.observer" />
      <queue physicalName="dadanet.events.dead" />
      <queue physicalName="dadanet.events.info" />
      <queue physicalName="dadanet.events.indexer" />
    </destinations>
  
    <destinationInterceptors>
      
      <virtualDestinationInterceptor>
        <virtualDestinations>
          <compositeQueue name="dadanet.events">
            <forwardTo>
              <queue physicalName="dadanet.events.incoming"/>
              <topic physicalName="dadanet.events.observer"/>
              <topic physicalName="dadanet.events.dead"/>
            </forwardTo>
          </compositeQueue>
        </virtualDestinations>
      </virtualDestinationInterceptor>

    </destinationInterceptors>

    <transportConnectors>
       <transportConnector name="stomp"   uri="stomp://localhost:61613"/>
    </transportConnectors>
  </broker>


  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
  <route>
    <from uri="activemq:dadanet.events.incoming"/>
    <choice>
      <when>
        <predicate>
          <header name="X-event-type"/>
          <isEqualTo value="info"/>
        </predicate>
        <to uri="activemq:dadanet.events.info"/>
      </when>
      <when>
        <predicate>
          <header name="X-event-type"/>
          <isEqualTo value="indexer"/>
        </predicate>
        <to uri="activemq:dadanet.events.indexer"/>
      </when>
      <otherwise>
        <to uri="activemq:dadanet.events.dead"/>
      </otherwise>
    </choice>
  </route>
  </camelContext>
  
</beans>

Reply via email to