Camel IMAP端点:“FailedToCreateRouteException ...无法解析端点:...原因是:必须指定主机且不能为空”

ttp71kqs  于 2022-11-07  发布在  Apache
关注(0)|答案(2)|浏览(143)

以下是我的POM:

<dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-mail</artifactId>
        <version>2.22.0<version>
    </dependency>

我的端点配置源自https://camel.apache.org/mail.htmlSamples 部分:

...
    from("imap://{{mail_user}}@{{imaps_server}} password={{mail_password}}&unseen=true&consumer.delay={{poll_interval}}")
    ...

结果是:

...
Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
Failed to create route route1: Route(route1)[[From[imap://{{mail_user}}@{{imaps_server}} pa...
because of Failed to resolve endpoint:
imap://********@mail.upcmail.at%20password=********&unseen=true&consumer.delay=10000
due to: host must be specified and not empty
...

mail.upcmail.at才是主机,不是吗?我错过了什么?

mutmk8jj

mutmk8jj1#

您的帖子中是否有拼写错误?URI中缺少问号(?)。这应该是:发件人(“imap://{{邮件用户}}@{{imap服务器}}?密码=...”)

mrphzbgm

mrphzbgm2#

这对我很有效:

@Override
  public void configure() throws Exception {
    from("imaps://imap.gmail.com?username=user@gmail.com&password=AppPassword&unseen=true&delay=6000")    
    .to("log:newmail");
  }

相关问题