すべての電子メールをダウンロードしてカスタム プロセッサ クラスに渡す単純な Mule 3.3.0 構成を試しています。メールが取得されたら、Gmail の受信トレイから削除する必要があります。しかし、それは機能していないようです。以下は私の mule-config.xml です
<spring:beans> <spring:import resource="classpath:spring/applicationContextServices-core.xml"/> <spring:import resource="classpath:spring/applicationContextServices-configuration.xml"/> <spring:bean id="emailSender" name="emailSender" class="com.test.EmailSender"/> <spring:bean id="retrieveEmailProcessor" name="retrieveEmailProcessor" class="com.test.RetrieveEmailProcessor"/> </spring:beans> <jms:activemq-connector name="Active_MQ" specification="1.1" username="[username]" password="[password]" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ"> <reconnect/> </jms:activemq-connector> <pop3s:connector name="pop3Connector" checkFrequency="45600" deleteReadMessages="true"/> <flow name="1_SendMessageToOwner" doc:name="1_SendMessageToOwner" doc:description="This is to confirm that your email was received successfully"> <jms:inbound-endpoint topic="PoolMessage" connector-ref="Active_MQ" doc:name="JMS"/> <component doc:name="Build Email Message"> <spring-object bean="emailSender"/> </component> <smtps:outbound-endpoint host="smtp.gmail.com" port="465" user="[username]%40gmail.com" password="[password]" from="[username]@gmail.com" responseTimeout="50000" doc:name="SMTP"/> </flow> <flow name="2_ReceiveConfirmation" doc:name="2_ReceiveConfirmation" doc:description="Retrieving Email"> <pop3s:inbound-endpoint connector-ref="pop3Connector" host="pop.gmail.com" port="995" user="[username]%40gmail.com" password="[password]" responseTimeout="10000" doc:name="Pop3"/> <component doc:name="Process Transaction - Confirmation Message" doc:description="Recieve confirmation from member."> <spring-object bean="retrieveEmailProcessor"/> </component> </flow> </mule>
および RetrieveEmailProcessor クラス
package com.test;
import java.util.Map;
import org.mule.api.MuleEventContext; import org.mule.api.lifecycle.Callable;
public class RetrieveEmailProcessor implements Callable {
public Object onCall(MuleEventContext eventContext) throws Exception { System.out.println("########## Entering RetrieveEmailProcessor.OnCall ##########"); Map dataMapMessage = (Map)eventContext.getMessage().getPayload(); String subject = (String)dataMapMessage.get("subject"); String toAddressList = (String)dataMapMessage.get("toAddressList"); String fromAddress = (String)dataMapMessage.get("fromAddress"); eventContext.getMessage().setOutboundProperty( "toAddresses", toAddressList); eventContext.getMessage().setOutboundProperty( "subject", subject); eventContext.getMessage().setOutboundProperty( "replyToAddresses", fromAddress); System.out.println("########## Exiting RetrieveEmailProcessor.OnCall ##########"); return dataMapMessage.get("mailBody"); }
}
私が行方不明であることは明らかですか?前もって感謝します