camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fintan Bolton <fintan.bol...@iona.com>
Subject Re: How camel differentiate between wiretap and staticRecipientList?
Date Thu, 19 Jun 2008 10:27:15 GMT

Hi Pratibha,

As far as I can tell, both of these examples are erroneous. For starters,
there is no <uri> element defined in the current Camel context schema. Here
is what I think the Wiretap example should look like:

<camelContext id="buildWireTap"
xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="seda:a"/>
    <to uri="seda:tap"/>
    <to uri="seda:b"/>
  </route>
</camelContext>

The main problem with the second example you quote is that it is mis-named:
it is not really a routing slip example (at least, not according to the
definition in Hohpe and Woolf's book), it is just a static list of
recipients. A genuine routing slip pattern can be defined in XML as follows:

<camelContext id="buildRoutingSlip"
xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="direct:c"/>
    <routingSlip headerName="aRoutingSlipHeader"/>
  </route>
</camelContext>

Where the <routingSlip> processor reads the header, 'aRoutingSlipHeader',
expecting to find a comma-separated list of Camel endpoint URIs. The listed
endpoints are then connected together to form a pipeline and the exchange is
sent to this pipeline.

You can also customize the delimiter character using the uriDelimiter
attribute. For example, to make the delimiter a # character:

<camelContext id="buildRoutingSlip"
xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="direct:c"/>
    <routingSlip headerName="aRoutingSlipHeader" uriDelimiter="#"/>
  </route>
</camelContext>

-----

pratibhaG wrote:
> 
> This is the configuration given in camel1.3  manual for wiretap pattern:
> <camelContext id="buildWireTap"
> xmlns="http://activemq.apache.org/camel/schema/
> spring">
>   <route>
>     <from uri="seda:a"/>
>     <to>
>       <uri>seda:tap</uri>
>       <uri>seda:b</uri>
>     </to>
>   </route>
> </camelContext>
> 
> This is the configuration given in camel1.3 manual for static routing slip
> pattern:
> <camelContext id="buildStaticRecipientList"
> xmlns="http://activemq.apache.org/
> camel/schema/spring">
>   <route>
>     <from uri="seda:a"/>
>     <to>
>       <uri>seda:b</uri>
>       <uri>seda:c</uri>
>       <uri>seda:d</uri>
>     </to>
>   </route>
> </camelContext>
> 
> Both of them seems same to me. How does camel know that it is wiretap or
> static recepient list?
> 
> Pratibha
> 

-- 
View this message in context: http://www.nabble.com/How-camel-differentiate-between-wiretap-and-staticRecipientList--tp17998160s22882p18005745.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message