1
如何從過濾器註釋方法切換到Spring集成java DSL過濾器。我怎樣才能調用過濾方法?彈簧集成dsl過濾器改爲過濾器方法註釋
IntegrationFlows.from("removeSession")
// remove chat session from user sessions map
.handle("sessionLogService", "removeChatSession")
// continue and remove user from ehcache only if user have no more opened sessions.
.filter(/* what's going here? */)
.get();
改爲過濾器註釋。
@Filter(inputChannel = "userGoOfflineFilter", outputChannel = "userGoOffline")
public boolean notifyOnlyIfLastConnectionClosed(SecureUser secureUser) {
ChatUser user = sessionUtils.getChatUser(secureUser.getId());
if(user == null || user.getChatSessionIds() == null || user.getChatSessionIds().isEmpty())
return true;
LOGGER.debug(secureUser.getFirstName()+": Offline message not sent yet");
return false;
}
非常感謝你這.filter( 「@ myFilter.notifyOnlyIfLastConnectionClosed( '有效載荷')」)工作的完美,我喜歡它。 :) – lubo08 2015-02-06 20:59:01