You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ilevina <Ir...@iona.com> on 2008/07/11 16:37:51 UTC
How to use Camel Spring XML Extension to configure ContentFilter
and MessageFilter EIP's
According online documentation MessageFilter route can be configured using
Camel Spring XML Extensions as follows:
<camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="seda:a"/>
<filter>
<xpath>$foo = 'bar'</xpath>
<to uri="seda:b"/>
</filter>
</route>
</camelContext>
Can <filter> be used to configure ContentFilter route (using Spring XML
Extensions) ?
Could you please provide example for ContentFilter?
What criteria is used to distinguish ContentFilter from MessageFilter when
they are configured with <filter> type?
--
View this message in context: http://www.nabble.com/How-to-use-Camel-Spring-XML-Extension-to-configure-ContentFilter-and-MessageFilter-EIP%27s-tp18405369s22882p18405369.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to use Camel Spring XML Extension to configure ContentFilter and MessageFilter EIP's
Posted by James Strachan <ja...@gmail.com>.
2008/7/14 ilevina <Ir...@iona.com>:
>
> Hi James,
>
> It is exactly what I was asking for, example on how to configure
> ContentFilter in XML. Thanks.
>
> However http://cwiki.apache.org/CAMEL/content-enricher.html contains exactly
> same configuration for ContentEnricher in XML. I understood differences in
> ContentEnricher and ContentFilter, however both sample are ambiguous, if for
> example I would like to use router.xml and map it to some GUI presentation
> of ContentEnricher or ContentFilter.
There are a number of EIP patterns which are kinda the same; if you
were using a Content Filter, Message Translator or Content Enricher -
they all do the same thing; transform the payload.
In some UI representation when folks invoke a Processor or bean they
should be able to choose the gregorgram they prefer; though from the
underlying Camel EIP route; they are all transformers really (either
<processor> or <bean/>). i.e. invoking a bean or processor or
expression (via <transform>) should all the Message Translator
gregorgrams by default - unless the user chooses to change the icon
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: How to use Camel Spring XML Extension to configure
ContentFilter and MessageFilter EIP's
Posted by ilevina <Ir...@iona.com>.
Hi James,
It is exactly what I was asking for, example on how to configure
ContentFilter in XML. Thanks.
However http://cwiki.apache.org/CAMEL/content-enricher.html contains exactly
same configuration for ContentEnricher in XML. I understood differences in
ContentEnricher and ContentFilter, however both sample are ambiguous, if for
example I would like to use router.xml and map it to some GUI presentation
of ContentEnricher or ContentFilter.
James.Strachan wrote:
>
> 2008/7/14 ilevina <Ir...@iona.com>:
>>
>> Hi William,
>>
>> Thanks for pointing to additional examples with 'MessageFilter'
>> configuration. However my Q was not about using any particular expression
>> language with filter pattern, or using <filter> to configure
>> 'MessageFilter', there are seems plenty od examples in Camel docs.
>>
>> Q was: if user can use 'Filter' processor(<filter>) to configure
>> ContentFilter pattern in XML? And if it is possible to use 'Filter'
>> processor configure both: MessageFilter or ContentFilter patterns in XML,
>> what will be a criteria to distinguish one configuration from another? It
>> seems that XML configuration is kind of ambiguous in such case?
>
> Just to check I understand what you're asking; <filter> in Camel
> refers to the Message Filter pattern....
> http://activemq.apache.org/camel/message-filter.html
>
> ContentFilter however is really a transformation...
> http://activemq.apache.org/camel/content-filter.html
>
> so you can create a content filter by just invoking a processor or a
> bean...
>
> <from uri="activemq:Input"/>
> <bean ref="myBeanName" method="doTransform"/>
> <to uri="activemq:Output"/>
>
> FWIW I just updated the wiki to be a bit clearer on this
> http://cwiki.apache.org/CAMEL/content-filter.html
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
--
View this message in context: http://www.nabble.com/How-to-use-Camel-Spring-XML-Extension-to-configure-ContentFilter-and-MessageFilter-EIP%27s-tp18405369s22882p18446064.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to use Camel Spring XML Extension to configure ContentFilter and MessageFilter EIP's
Posted by James Strachan <ja...@gmail.com>.
2008/7/14 ilevina <Ir...@iona.com>:
>
> Hi William,
>
> Thanks for pointing to additional examples with 'MessageFilter'
> configuration. However my Q was not about using any particular expression
> language with filter pattern, or using <filter> to configure
> 'MessageFilter', there are seems plenty od examples in Camel docs.
>
> Q was: if user can use 'Filter' processor(<filter>) to configure
> ContentFilter pattern in XML? And if it is possible to use 'Filter'
> processor configure both: MessageFilter or ContentFilter patterns in XML,
> what will be a criteria to distinguish one configuration from another? It
> seems that XML configuration is kind of ambiguous in such case?
Just to check I understand what you're asking; <filter> in Camel
refers to the Message Filter pattern....
http://activemq.apache.org/camel/message-filter.html
ContentFilter however is really a transformation...
http://activemq.apache.org/camel/content-filter.html
so you can create a content filter by just invoking a processor or a bean...
<from uri="activemq:Input"/>
<bean ref="myBeanName" method="doTransform"/>
<to uri="activemq:Output"/>
FWIW I just updated the wiki to be a bit clearer on this
http://cwiki.apache.org/CAMEL/content-filter.html
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: How to use Camel Spring XML Extension to configure
ContentFilter and MessageFilter EIP's
Posted by ilevina <Ir...@iona.com>.
Hi William,
Thanks for pointing to additional examples with 'MessageFilter'
configuration. However my Q was not about using any particular expression
language with filter pattern, or using <filter> to configure
'MessageFilter', there are seems plenty od examples in Camel docs.
Q was: if user can use 'Filter' processor(<filter>) to configure
ContentFilter pattern in XML? And if it is possible to use 'Filter'
processor configure both: MessageFilter or ContentFilter patterns in XML,
what will be a criteria to distinguish one configuration from another? It
seems that XML configuration is kind of ambiguous in such case?
William Tam wrote:
>
> Hi Irene,
>
> This wiki page http://activemq.apache.org/camel/xpath.html contains
> some examples to show how to use XPath to filter messages based on
> content. There are other supported languages as well
> http://activemq.apache.org/camel/languages.html.
>
> Cheers,
> William
>
>
> On Fri, Jul 11, 2008 at 10:37 AM, ilevina <Ir...@iona.com> wrote:
>>
>> According online documentation MessageFilter route can be configured
>> using
>> Camel Spring XML Extensions as follows:
>>
>> <camelContext id="camel"
>> xmlns="http://activemq.apache.org/camel/schema/spring">
>> <route>
>> <from uri="seda:a"/>
>> <filter>
>> <xpath>$foo = 'bar'</xpath>
>> <to uri="seda:b"/>
>> </filter>
>> </route>
>> </camelContext>
>>
>> Can <filter> be used to configure ContentFilter route (using Spring XML
>> Extensions) ?
>> Could you please provide example for ContentFilter?
>> What criteria is used to distinguish ContentFilter from MessageFilter
>> when
>> they are configured with <filter> type?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/How-to-use-Camel-Spring-XML-Extension-to-configure-ContentFilter-and-MessageFilter-EIP%27s-tp18405369s22882p18405369.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-use-Camel-Spring-XML-Extension-to-configure-ContentFilter-and-MessageFilter-EIP%27s-tp18405369s22882p18444505.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to use Camel Spring XML Extension to configure ContentFilter and MessageFilter EIP's
Posted by William Tam <em...@gmail.com>.
Hi Irene,
This wiki page http://activemq.apache.org/camel/xpath.html contains
some examples to show how to use XPath to filter messages based on
content. There are other supported languages as well
http://activemq.apache.org/camel/languages.html.
Cheers,
William
On Fri, Jul 11, 2008 at 10:37 AM, ilevina <Ir...@iona.com> wrote:
>
> According online documentation MessageFilter route can be configured using
> Camel Spring XML Extensions as follows:
>
> <camelContext id="camel"
> xmlns="http://activemq.apache.org/camel/schema/spring">
> <route>
> <from uri="seda:a"/>
> <filter>
> <xpath>$foo = 'bar'</xpath>
> <to uri="seda:b"/>
> </filter>
> </route>
> </camelContext>
>
> Can <filter> be used to configure ContentFilter route (using Spring XML
> Extensions) ?
> Could you please provide example for ContentFilter?
> What criteria is used to distinguish ContentFilter from MessageFilter when
> they are configured with <filter> type?
>
> --
> View this message in context: http://www.nabble.com/How-to-use-Camel-Spring-XML-Extension-to-configure-ContentFilter-and-MessageFilter-EIP%27s-tp18405369s22882p18405369.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>