Apache Camel을 배우려고했습니다.Apache Camel은 Gmail 계정에서 읽지 않은 메일을 읽습니다.
Gmail받은 편지함 읽지 않은 메일을 읽으려고합니다.
검색하는 동안 코드 스 니펫을 받았지만 성공하지 못했습니다.
누군가가 실수를 지적하는 경우
,PollingConsumer pollingConsumer = null;
CamelContext context = new DefaultCamelContext();
Endpoint endpoint = context.getEndpoint("imaps://imap.gmail.com?username=" + mailId + "&password=" + password + "&delete=false&peek=false&unseen=true&consumer.delay=6000&closeFolder=false&disconnect=false");
System.out.println("end point:"+endpoint);
pollingConsumer = endpoint.createPollingConsumer();
System.out.println("polling consumer:"+pollingConsumer);
pollingConsumer.start();
pollingConsumer.getEndpoint().createExchange();
System.out.println("Exchange is created:");
Exchange exchange = pollingConsumer.receive();
System.out.println("pollingConsumer.receive()");
pollingConsumer.receive();
는 내 편지함에 읽지 않은 메일을 차단지고 있습니다. 또한 pollingConsumer.receive(6000);
을 시도했지만 null을 반환합니다.
Gmail 설정에서 IMAP 액세스를 사용하도록 설정합니다. 내가 누락 된 것이 있습니까?
프록시로 실행하고 있습니까? –
코드가 저에게 효과적입니다. 문제는 낙타 밖입니다. – ltsallas
Itsallas와 James에게 도움을 청합니다. 나는 해결책을 썼다. 그것은 내 편이 잘못이었습니다. – Jayesh