Guillaume Nodet wrote:
> On 3/12/07, Thomas TERMIN <[EMAIL PROTECTED]> wrote:
>>
>>
>> Peter my colleague asked if you need a switch-filter as an EIP
>> > component. It does nothing more then check a property for message flow.
>> > If this property is true it sends the message to the destination and if
>> > it is false the exchange will be discarde. This is helpfull if you have
>> > different installations where some services are installed or not
>> > installed in servicemix. What he want to do is that you can enable or
>> > disbale the flow via JMX as well as an property in a property file at
>> > runtime. (Hope the explanation was understandable)
>>
>>
>> Sounds good, but I wonder wha's the difference with the
>> http://incubator.apache.org/servicemix/servicemix-eip.html#servicemix-eip-MessageFilter
>>
>> .
>> We only need to implement a new predicate based on properties, which
>> could
>> be
>> reused by the router for example.  I'm not sure if this is what you meant
>> or not
>> (maybe you were talking about a system property ?)
>> As for the JMX stuff, it's a very good idea.
>>
>>
>> I'm still not sure if you were talking about a property on the JBI
> exchange
> or a system property. There's no predicate on message properties it
> could be implemented easily (and should anyway).  As I said, JMX controlled
> routers or filters would be very useful for manually re-routing flows, etc
This filter is intended just as a on/off filter.

<eip:filter>
     <eip:property-predicate
propertyResource="file:conf/feature.properties" propertyName="on"/>
</eip:filter>

So as you can see above there is a spring resourece defined and a
property name. This property name will be read from the resource and can
have the value true(on) or false(off). The property could also be an
exchange property. The configuration would be:

<eip:filter>
     <eip:property-predicate fromExchange="true" propertyName="on"/>
</eip:filter>


We implemented this just as a SwitchPredicate which just returns true or
false depending on the property.


Reply via email to