2015-05-04 127 views

回答

1

有關使用自定義的搜索關鍵詞如何?它可以從駱駝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(); 
+0

我收到的電子郵件,不發送it.Sorry的混亂 – user4862424

+0

@ user4862424更新我的答案。希望這可以幫助。 –

+0

如何在routebulder中使用SearchTerm – user4862424

0

爲我工作:

choice() 
    .when(header("subject").isEqualTo("My Subject")).log("YES: ${header.subject}").to("direct:subroute1") 
    .otherwise().log("NO: ${header.subject}").to("direct:subroute2");