Hi

There is EIPs for that such as the filter or content based router
http://camel.apache.org/eip

But as a component writer, you are free to develop you component as you want.
And if it makes sense to have filter option built-in then go ahead.




On Tue, Sep 11, 2012 at 9:30 AM, Sura Monday <sura.mon...@yahoo.com> wrote:
> Hi All,
> I am trying to implement a custom end point.
> An example route looks like this:
>
> from("jason:message?illoc_force=tell")
>                      .to("jason:message?sender = mary");
>
> With the properties illoc_force and sender set in the route means that the 
> first end point should pass only messages that has illoc_force = tell. 
> Similarly, the second end point should process only messages sent by mary.
>
> In order to achieve this, I do the following in the consumer:
>
> String e_illoc = endpoint.getIlloc_force();
> String illoc = value sent by my application;
>
> if (e_illoc.equals(illoc ) || e_illoc == null)
>                  getProcessor().process(exchange);
>
> this assures that only messages with illoc_force=tell are sent in the router.
>
> Similarly at the producer,
> String er = endpoint.getReceiver();
> String r = (String)headerInfo.get("receiver");
>
> if ((r.equals(ei) || er.equals(null))
>  pass it to my application
>
> However, when I look at the source codes of some components in the camel 
> source code, I do not see this type of filtering done.
>
> So I would like to know whether this type of filtering logic is against camel 
> design conventions?
>
> /Sura



-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to