Hi. Thanks for the advice on RC2 and transactions. I've ditched M4 based on your advice. Trouble is I've hit a problem already and am wondering whether to raise as a Jira bug...
With RC2, should-delete-messages=false and a trans sync element, I get this problem.
Code:
[] DEBUG 113050 [24 Oct 2012 14:30:22,111] AbstractPlatformTransactionManager - Creating new transaction with name [org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,timeout_10000
[] DEBUG 113050 [24 Oct 2012 14:30:22,111] TransactionSynchronizationManager - Initializing transaction synchronization
[] DEBUG 113050 [24 Oct 2012 14:30:22,111] TransactionAspectSupport - Getting transaction for [org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call]
[] DEBUG 113050 [24 Oct 2012 14:30:22,111] TransactionSynchronizationManager - Bound value [org.springframework.integration.transaction.IntegrationResourceHolder@3a0c2cb] for key [org.springframework.integration.mail.MailReceivingMessageSource@33e4034] to
thread [task-scheduler-5]
[] DEBUG 113050 [24 Oct 2012 14:30:22,111] TransactionSynchronizationManager - Retrieved value [org.springframework.integration.transaction.IntegrationResourceHolder@3a0c2cb] for key [org.springframework.integration.mail.MailReceivingMessageSource@33e4034]
bound to thread [task-scheduler-5]
DEBUG POP3: connecting to host "nn.nnn.n.nn", port 110, isSSL false
S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 (xxxxxxxxxx.xxxxxxxxx.xxxxx.xxxx.xxxx) ready.
C: USER xxxxxxx
S: +OK
C: PASS xxxxxxxxxxxxxx
S: +OK User successfully logged on.
[] DEBUG 113081 [24 Oct 2012 14:30:22,142] AbstractMailReceiver - opening folder [pop3://xxxxxxxxx:*****@nn.nnn.n.nn/inbox]
C: STAT
S: +OK 1 46952
[] INFO 113081 [24 Oct 2012 14:30:22,142] AbstractMailReceiver - attempting to receive mail from folder [inbox]
C: NOOP
S: +OK
[] DEBUG 113081 [24 Oct 2012 14:30:22,142] AbstractMailReceiver - found 1 new messages
C: TOP 1 0
S: +OK
Received: by xxx99999
id <01CDB1EB.A960F132@xxx99999>; Wed, 24 Oct 2012 14:29:58 +0100
Content-class: urn:content-classes:message
Subject: HTML, one attachment, RC2 test 14:29
Date: Wed, 24 Oct 2012 14:29:58 +0100
Message-ID: <51E87F6C6074754DB9999999A293CBF3518183@xxx99999>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----_=_NextPart_001_01XXX1EB.A960F132"
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Thread-Topic: HTML, one attachment, RC2 test 14:29
Thread-Index: Ac2w8BmTZ/2ABx6ZQPqvedXnPVyVDQ==
X-MimeOLE: Produced By Microsoft Exchange V6.5
From: "xxxxxxx" <xxxxxxx@xxxx.xxx.xxxx.xx>
To: "xxxxxxxx" <xxxxxxxx@xxxx.xxxx.xxx.xx>
.
C: LIST 1
S: +OK 1 46952
[] DEBUG 113128 [24 Oct 2012 14:30:22,189] AbstractMailReceiver - Received 1 messages
[] DEBUG 113143 [24 Oct 2012 14:30:22,204] AbstractMailReceiver - USER flags are not supported by this mail server. Flagging message with system flag
This next three lines are key to the problem I think - it is quitting before the email attachment is read - there is no "C: RETR 1" entry like with the M4 version:
Code:
C: NOOP
S: +OK
C: QUIT
S: +OK Microsoft Exchange Server 2003 POP3 server version 6.5.7638.1 signing off.
[] DEBUG 113143 [24 Oct 2012 14:30:22,204] MailReceivingMessageSource - received mail message [com.sun.mail.pop3.POP3Message@3a186fb]
[] DEBUG 113159 [24 Oct 2012 14:30:22,220] SourcePollingChannelAdapter - Poll resulted in Message: [Payload=com.sun.mail.pop3.POP3Message@3a186fb][Headers={timestamp=1351085422220, id=d6fba356-a6d4-4124-9bf2-f62833e64d02}]
[] DEBUG 113159 [24 Oct 2012 14:30:22,220] AbstractMessageChannel$ChannelInterceptorList - preSend on channel 'receiveEmailChannel', message: [Payload=com.sun.mail.pop3.POP3Message@3a186fb][Headers={timestamp=1351085422220, id=d6fba356-a6d4-4124-9bf2-f6283
3e64d02}]
[] DEBUG 113159 [24 Oct 2012 14:30:22,220] AbstractMessageChannel$ChannelInterceptorList - preSend on channel 'logger', message: [Payload=com.sun.mail.pop3.POP3Message@3a186fb][Headers={timestamp=1351085422220, id=d6fba356-a6d4-4124-9bf2-f62833e64d02}]
[] DEBUG 113175 [24 Oct 2012 14:30:22,236] AbstractMessageHandler - org.springframework.integration.handler.LoggingHandler#0 received message: [Payload=com.sun.mail.pop3.POP3Message@3a186fb][Headers={timestamp=1351085422220, id=d6fba356-a6d4-4124-9bf2-f628
33e64d02}]
[] DEBUG 113190 [24 Oct 2012 14:30:22,251] LoggingHandler - com.sun.mail.pop3.POP3Message@3a186fb
[] DEBUG 113190 [24 Oct 2012 14:30:22,251] AbstractMessageChannel$ChannelInterceptorList - postSend (sent=true) on channel 'logger', message: [Payload=com.sun.mail.pop3.POP3Message@3a186fb][Headers={timestamp=1351085422220, id=d6fba356-a6d4-4124-9bf2-f6283
3e64d02}]
[] DEBUG 113190 [24 Oct 2012 14:30:22,251] AbstractMessageHandler - ServiceActivator for [org.springframework.integration.handler.MethodInvokingMessageProcessor@22ef823] received message: [Payload=com.sun.mail.pop3.POP3Message@3a186fb][Headers={timestamp=1
This results in an exception when trying to retreive the input stream of the attachment :
Code:
javax.mail.MessagingException: No inputstream from datasource;
nested exception is:
java.lang.IllegalStateException: Folder is not Open
at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:732)
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:466)
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:242)
...
With should-delete-messages set to true in integration.xml the stream is retrieved however, but the message gets deleted and not by any transaction sync code :-(
Code:
[] DEBUG 358193 [24 Oct 2012 14:18:09,695] AbstractMailReceiver - USER flags are...
C: RETR 1
S: +OK