0
작동하지뮬 : 표현 필터는 일부 세션 변수가 허위 또는 해당하는 경우 메시지를 필터링 할의 requirment를 갖는
flow.xml
<spring:beans>
<spring:bean id="serviceBean" class="com.uidai.ServiceBean"/>
</spring:beans>
<flow name="messagefilterFlow1" doc:name="messagefilterFlow1">
<file:inbound-endpoint responseTimeout="10000" doc:name="File" path="D:/sample" />
<invoke object-ref="serviceBean" method="enrichFilter" doc:name="Invoke" methodArguments="#[sessionVars],#[message]"/>
<logger level="INFO" message="#[sessionVars['filter']]" doc:name="Logger"/>
<!--<message-property-filter pattern="#[sessionVars['filter']]=true" caseSensitive="true" doc:name="Message Property"/>-->
<expression-filter expression="#[sessionVars['filter']]" doc:name="Expression"/>
<file:outbound-endpoint responseTimeout="10000" doc:name="File" path="D:/sample2"/>
</flow>
서비스 빈 메소드
public void enrichFilter(MessagePropertyMapContext mapContext, MessageContext messageContext){
mapContext.put("filter", false);
System.out.println("mapContext" + mapContext);
System.out.println("message Context:::" + messageContext);
}
Reading a file from inbound and setting a session variable in spring bean method. Wanted to filter the message on basis of filter value so that if filter value is true outbound file is not written and message is filtered. Even if filter value is true or false a lock is hold on file by inbound endpoint and processing stops.
expression이 "# [header : filter = true]"인 경우 아웃 바운드 속성에서만 작동하며 메시지가 필터링 된 파일 인 경우에도 세션에서 작동하지 않습니다. 파일에 대한 인바운드 보류 잠금과 잠금을 해제하지 않습니다. catch 필터 예외 전략에서 처리 할 수 있도록 메시지가 필터링 될 때 예외가 발생하지 않습니다. –
메시지 필터에서 식 필터를 래핑 한 후 문제가 해결되었습니다. message-filter> –