0
我試圖根據收到的電子郵件主題創建將消息發送到不同端點的路由。如何引用駱駝路由中的電子郵件主題
如何引用RouteBuilder中的主題。
我試着標題( 「主體」)。isEqualTo(...)和它不工作
我試圖根據收到的電子郵件主題創建將消息發送到不同端點的路由。如何引用駱駝路由中的電子郵件主題
如何引用RouteBuilder中的主題。
我試着標題( 「主體」)。isEqualTo(...)和它不工作
有關使用自定義的搜索關鍵詞如何?它可以從駱駝2.11獲得。從駱駝文檔:
You can configure a searchTerm on the MailEndpoint which allows you to filter out unwanted mails.
Java示例:
// we just want the unseen mails which is not spam
SearchTermBuilder builder = new SearchTermBuilder();
builder.unseen().body(Op.not, "Spam").subject(Op.not, "Spam")
// which was sent from either foo or bar
.from("[email protected]").from(Op.or, "[email protected]");
// .. and we could continue building the terms
SearchTerm term = builder.build();
爲我工作:
choice()
.when(header("subject").isEqualTo("My Subject")).log("YES: ${header.subject}").to("direct:subroute1")
.otherwise().log("NO: ${header.subject}").to("direct:subroute2");
我收到的電子郵件,不發送it.Sorry的混亂 – user4862424
@ user4862424更新我的答案。希望這可以幫助。 –
如何在routebulder中使用SearchTerm – user4862424