2014-02-13 3 views
0

카멜 documentation for Message Filter에 콩을 필터 사용 방법은 "필터 콩"그래서 등을 이용하여 여러 개의 자바 DSL의 예를 보여줍니다 봄 XML 콩 : 위의 코드에서낙타 메시지가 봄 XML

<route id="my-route"> 
    <from uri="direct:a" /> 
    <filter> 
     <method>??? how to call MyBean#isGoldCustomer from here???</method> 
     <to uri="direct:b" /> 
    </filter> 
</route> 

, 어떻게 자바 빈과 내 <filter/>를 연결하고, 자바 빈 구현해야하는 것이 무엇 인터페이스/확장합니까?

답변

2

이처럼 할 수 있어야 :

<bean id="myCustomPredicate" class="com.hveiga.test.MyCustomPredicate"/> 

<route id="my-route"> 
    <from uri="direct:a" /> 
    <filter> 
     <method ref="myCustomPredicate" /> 
     <to uri="direct:b" /> 
    </filter> 
</route> 
0
<bean id="myCustomPredicate" class="com.hveiga.test.MyCustomPredicate"/> 
<route id="my-route"> 
    <from uri="direct:a" /> 
    <filter> 
     <method ref="myCustomPredicate" method="myCustomPredicateMethod"/> 
     <to uri="direct:b" /> 
    </filter> 
</route>