0
我試圖使用integration
訪問Gmail帳戶。我需要使用Http.inboundGateway
。所以增加了這樣一行未指定密碼
.from(Mail.imapIdleAdapter("imaps://"+(Http.inboundGateway(String.format("%s:%[email protected]/INBOX", "myEmail", "myPassword"))).toString())
但問題是,在運行時就抱怨說,
javax.mail.AuthenticationFailedException: failed to connect, no password specified?
正如你所看到的,我已經在我的要求下定義我的密碼,但它不能認識它,也我相信通過是真的
下面是完整的代碼:
@Bean
IntegrationFlow processInvoiceFlow() {
return IntegrationFlows
.from(Mail.imapIdleAdapter("imaps://"+(Http.inboundGateway(String.format("%s:%[email protected]/INBOX", "myEmail", "myPassword"))).toString())
.selectorExpression("subject matches '.*invoice.*'"))
.transform("@invoiceProcessor.extractInvoice(payload)")
.route("#xpath(payload, '//total <= 1800', 'string')", mapping -> mapping
.subFlowMapping("true", sf -> sf
.handle("invoiceProcessor", "processInvoice"))
.subFlowMapping("false", sf -> sf
.handle(System.out::println))
)
.get();
}
的一點是是,我有沒有Http.inboundGateway
使用訪問該帳戶:
.from(Mail.imapIdleAdapter(String.format("imaps://%s:%[email protected]/INBOX", myEmail, myPassword))
@Artem Bilan ... –