camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sura Monday <sura.mon...@yahoo.com>
Subject implementing route filter proeprties.
Date Tue, 11 Sep 2012 07:30:04 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message