How camel differentiate between wiretap and staticRecipientList?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How camel differentiate between wiretap and staticRecipientList?

pratibhaG
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
Reply | Threaded
Open this post in threaded view
|

Re: How camel differentiate between wiretap and staticRecipientList?

Jon Anstey
It doesn't. They are the same thing :) Well, except that to be a bonefide wiretap, you must restrict it to two outputs.

Looking at the definition of a wiretap: "The Wire Tap is a fixed Recipient List with two output channels"
http://www.enterpriseintegrationpatterns.com/WireTap.html

Make sense?

Cheers,
Jon

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
Reply | Threaded
Open this post in threaded view
|

Re: How camel differentiate between wiretap and staticRecipientList?

Fintan Bolton
In reply to this post by pratibhaG
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
Reply | Threaded
Open this post in threaded view
|

Re: How camel differentiate between wiretap and staticRecipientList?

pratibhaG
got it,

Pratibha