I am working with camel-mail-starter
version 3.12.0
I have configured the route this way:
String from = protocol + "://" + host + ":" + port + "?username="
+ username + "&password=" + password + "&delete=" + removeAfterConsuming
+ "&mail.pop3.starttls.enable=true&debugMode=true";
RouteBuilder emailListener = new RouteBuilder () {
@Override
public void configure() throws Exception {
from (from)
.process (new EmailProcessor (body, client))
.log("${exchange.message}");
}
};
My Processor
public void process(Exchange exchange) throws Exception {
MailMessage message = exchange.getIn(MailMessage.class);
MimeMessageParser parser = new MimeMessageParser(
(IMAPMessage) message.getOriginalMessage()
);
try {
parser.parse();
} catch (Exception e) {
ApplicationException applicationException = new ApplicationException(
e.getStackTrace(),
Collections.singletonMap("process", " Inside camel mail"),
getClass(), "33"
);
applicationException.notifyViaEmail();
}
}
When I run this, I get the following exception
Caused by: org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations possible: [public abstract org.apache.camel.Message org.apache.camel.Exchange.getMessage(), public abstract java.lang.Object org.apache.camel.Exchange.getMessage(java.lang.Class)] on the exchange: Exchange[166D4FAD964C49D-0000000000000000]
I don't know what I am doing wrong