You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by HockeyDave <da...@yahoo.com> on 2008/10/23 00:04:13 UTC

processOnlyUnseenMessages=true not working in 1.4.0?

<route> <!--
&amp;deleteProcessedMessages=true&amp;contentType=multipart/mixed -->
			<from
			
uri="pop3://username@myhost.mysite.corp:110?password=abcdefg&amp;consumer.delay=60000&amp;processOnlyUnseenMessages=true&amp;deleteProcessedMessages=false"
/>
			<to uri="bean:MailReader" />
		</route>

My expectation is that processOnlyUnseenMessage being true would mean that
my MailReader bean's process method would only be called once per mail
message.  However, unless I set deleteProcessedMessages=true (or leave it
defaulted), then the mail reader bean gets called every 60 seconds for the
same mail message.

Am I missing something?

Thanks.
-- 
View this message in context: http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20120636.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: processOnlyUnseenMessages=true not working in 1.4.0?

Posted by Jon Anstey <ja...@gmail.com>.
#2 should be fixed in the next SNAPSHOT deploy.

On Sat, Oct 25, 2008 at 9:51 PM, HockeyDave <da...@yahoo.com>wrote:

>
> Hi Claus,
>
>  Okay, with some help from the team, I figured out why my maven access to
> 1.5-SNAPSHOT wasn't working and fixed it.  Here are the results.
>
> 1.  processOnlyUnseenMessage=true still does not work.
>
> 2.  New Exception in trying to process Excel files.  This works in 1.4.0 so
> something got
> broken.
>
> [org.apache.camel.NoTypeConversionAvailableException] thrown by target
> class
> [com.contextweb.mail.MailReader] and method [public abstract void
> org.apache.camel.Processor.process(org.apache.camel.Exchange) throws
> java.lang.Exception]org.apache.camel.NoTypeConversionAvailableException: No
> type converter available to convert from type: class
> com.sun.mail.util.BASE64DecoderStream to the required type:
> org.apache.commons.logging.Log with value
> com.sun.mail.util.BASE64DecoderStream@aa4bf8
>        at
>
> org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:117)
>        at
> org.apache.camel.util.ExchangeHelper.convertToType(ExchangeHelper.java:180)
>        at
>
> org.apache.camel.component.bean.BeanInfo.chooseMethodWithMatchingBody(BeanInfo.java:335)
>        at
> org.apache.camel.component.bean.BeanInfo.chooseMethod(BeanInfo.java:293)
>        at
>
> org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:114)
>        at
>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:111)
>        at
>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:92)
>        at
>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:66)
>        at
> org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:151)
>        at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:88)
>        at
>
> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:85)
>        at
>
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:102)
>        at
>
> org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:108)
>        at
> com.contextweb.mail.MailReader.processSaveReport(MailReader.java:301)
>        at
> com.contextweb.mail.MailReader.processExcelAttachment(MailReader.java:287)
>        at com.contextweb.mail.MailReader.process(MailReader.java:108)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:597)
>        at
>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
>        at
>
> org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:126)
>        at
>
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
>        at
>
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
>        at $Proxy24.process(Unknown Source)
>        at
>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:80)
>        at
>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:92)
>        at
>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:66)
>        at
>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>        at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
>        at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
>        at
>
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
>        at
>
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
>        at
>
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
>        at
>
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
>        at
>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
>        at
>
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
>        at
>
> org.apache.camel.component.mail.MailConsumer.processMessage(MailConsumer.java:169)
>        at
>
> org.apache.camel.component.mail.MailConsumer.processMessages(MailConsumer.java:151)
>        at
> org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:105)
>        at
>
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
>        at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>        at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>        at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>        at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
>        at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>        at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>        at java.lang.Thread.run(Thread.java:619)
>
> --
> View this message in context:
> http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20169282.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Jon

http://janstey.blogspot.com/

RE: processOnlyUnseenMessages=true not working in 1.4.0?

Posted by HockeyDave <da...@yahoo.com>.
Hi Claus,

  Okay, with some help from the team, I figured out why my maven access to
1.5-SNAPSHOT wasn't working and fixed it.  Here are the results.

1.  processOnlyUnseenMessage=true still does not work.

2.  New Exception in trying to process Excel files.  This works in 1.4.0 so
something got 
broken.

[org.apache.camel.NoTypeConversionAvailableException] thrown by target class
[com.contextweb.mail.MailReader] and method [public abstract void
org.apache.camel.Processor.process(org.apache.camel.Exchange) throws
java.lang.Exception]org.apache.camel.NoTypeConversionAvailableException: No
type converter available to convert from type: class
com.sun.mail.util.BASE64DecoderStream to the required type:
org.apache.commons.logging.Log with value
com.sun.mail.util.BASE64DecoderStream@aa4bf8
	at
org.apache.camel.impl.converter.DefaultTypeConverter.convertTo(DefaultTypeConverter.java:117)
	at
org.apache.camel.util.ExchangeHelper.convertToType(ExchangeHelper.java:180)
	at
org.apache.camel.component.bean.BeanInfo.chooseMethodWithMatchingBody(BeanInfo.java:335)
	at org.apache.camel.component.bean.BeanInfo.chooseMethod(BeanInfo.java:293)
	at
org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:114)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:111)
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:92)
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:66)
	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:151)
	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:88)
	at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:85)
	at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:102)
	at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:108)
	at com.contextweb.mail.MailReader.processSaveReport(MailReader.java:301)
	at
com.contextweb.mail.MailReader.processExcelAttachment(MailReader.java:287)
	at com.contextweb.mail.MailReader.process(MailReader.java:108)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
	at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
	at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
	at
org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:126)
	at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
	at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
	at $Proxy24.process(Unknown Source)
	at
org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:80)
	at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:92)
	at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:66)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:75)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:172)
	at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:93)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:63)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:47)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
	at
org.apache.camel.component.mail.MailConsumer.processMessage(MailConsumer.java:169)
	at
org.apache.camel.component.mail.MailConsumer.processMessages(MailConsumer.java:151)
	at org.apache.camel.component.mail.MailConsumer.poll(MailConsumer.java:105)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
	at java.lang.Thread.run(Thread.java:619)

-- 
View this message in context: http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20169282.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: processOnlyUnseenMessages=true not working in 1.4.0?

Posted by HockeyDave <da...@yahoo.com>.
Microsoft Exchange Server (sorry).  I've turned on debugging, but won't be
able to give you results for a bit as I'm right in the middle of trying to
resolve an AOP issue.

-- 
View this message in context: http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20136394.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: processOnlyUnseenMessages=true works for IMAP

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi Dave

Thanks for the findings. I have added a section to the camel mail documentation with these links.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: HockeyDave [mailto:david_peterson4146@yahoo.com] 
Sent: 26. oktober 2008 15:36
To: camel-user@activemq.apache.org
Subject: processOnlyUnseenMessages=true works for IMAP


Okay, I did some JavaMail research and discovered that Pop3 does not support
Flags.Flag.RECENT.   I switched to using IMAP instead w/ 1.4.0 and this now
works.

http://java.sun.com/products/javamail/javadocs/com/sun/mail/pop3/package-summary.html

http://java.sun.com/products/javamail/javadocs/com/sun/mail/imap/package-summary.html

http://java.sun.com/products/javamail/javadocs/javax/mail/Flags.html

-- 
View this message in context: http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20174089.html
Sent from the Camel - Users mailing list archive at Nabble.com.


processOnlyUnseenMessages=true works for IMAP

Posted by HockeyDave <da...@yahoo.com>.
Okay, I did some JavaMail research and discovered that Pop3 does not support
Flags.Flag.RECENT.   I switched to using IMAP instead w/ 1.4.0 and this now
works.

http://java.sun.com/products/javamail/javadocs/com/sun/mail/pop3/package-summary.html

http://java.sun.com/products/javamail/javadocs/com/sun/mail/imap/package-summary.html

http://java.sun.com/products/javamail/javadocs/javax/mail/Flags.html

-- 
View this message in context: http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20174089.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: processOnlyUnseenMessages=true not working in 1.4.0?

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Yeah that is the idea.

deleteProcessedMessages=false would NOT delete the mail but set the status to SEEN.
deleteProcessedMessages=true will DELETE the mail

So I guess that even though you have processOnlyUnseenMessages=true then the mail status is somehow not filtering the SEEN.

What mail server is you using?
Could you try adding some debug logging to org.apache.camel and also the mail debug as well?

http://activemq.apache.org/camel/mail.html
debugMode 	 false 	 As of Camel 1.4 its possible to enable the debug mode on the underlying mail framework. SUN Mail framework will default output to System.out.

Adding debugMode=true to the URI




Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: HockeyDave [mailto:david_peterson4146@yahoo.com] 
Sent: 23. oktober 2008 00:04
To: camel-user@activemq.apache.org
Subject: processOnlyUnseenMessages=true not working in 1.4.0?


<route> <!--
&amp;deleteProcessedMessages=true&amp;contentType=multipart/mixed -->
			<from
			
uri="pop3://username@myhost.mysite.corp:110?password=abcdefg&amp;consumer.delay=60000&amp;processOnlyUnseenMessages=true&amp;deleteProcessedMessages=false"
/>
			<to uri="bean:MailReader" />
		</route>

My expectation is that processOnlyUnseenMessage being true would mean that
my MailReader bean's process method would only be called once per mail
message.  However, unless I set deleteProcessedMessages=true (or leave it
defaulted), then the mail reader bean gets called every 60 seconds for the
same mail message.

Am I missing something?

Thanks.
-- 
View this message in context: http://www.nabble.com/processOnlyUnseenMessages%3Dtrue-not-working-in-1.4.0--tp20120636s22882p20120636.html
Sent from the Camel - Users mailing list archive at Nabble.com.