Hi,

I am trying to build a robust Jms to mail bridge with ServiceMix 3.3.1 and I
am encountering the following difficulties.

When using an InOnly MEP, if the mail connection fails (because of an
incorrect connection string for example) an error is generated but the JMS
message is consumed anyways (i.e. no rollback).

ERROR - MailComponent                  - Error sending mail...
javax.mail.AuthenticationFailedException
        at javax.mail.Service.connect(Service.java:306)
        at
org.apache.servicemix.mail.MailSenderEndpoint.processInOnly(MailSenderEndpoint.java:117)
        at
org.apache.servicemix.common.endpoints.ProviderEndpoint.process(ProviderEndpoint.java:102)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:627)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:581)
        at
org.apache.servicemix.common.AsyncBaseLifeCycle.onMessageExchange(AsyncBaseLifeCycle.java:535)
        at
org.apache.servicemix.common.SyncLifeCycleWrapper.onMessageExchange(SyncLifeCycleWrapper.java:60)
        at
org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:623)
        at
org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:172)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:168)
        at
org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
ERROR - MailComponent                  - Error processing exchange InOnly[
  id: ID:10.244.140.130-128c9c24ae8-7:6
  status: Active
  role: provider
  service: {http://com.sungard.decalog/jms2mail}mail
  endpoint: endpoint
  in: <?xml version="1.0" encoding="UTF-8"?><message>hello</message>
]

When switching to a RobustInOnly MEP, the above problem is solved but the
Jms consumer service is requested to send a reply message.
Since I did not configure a reply destination, there is an error leading to
a rollback and the Jms message is returned to the queue (although a mail was
sent...).
I could create a dummy reply destination but this would require additional
and, in my particular use case useless, configuration and setup.

Here is the JMS Consumer service definition:

        <jms:consumer service="jms2mail:jms"
                endpoint="endpoint"
                targetService="jms2mail:pipeline"
        destinationName="sims.jms.EventPartnerQueue"
        connectionFactory="#connectionFactory" 
        destinationResolver="#destinationResolver"
        marshaler="#marshaler" 
        listenerType="default"
        transacted="jms"
        cacheLevel="3"
        concurrentConsumers="1"
        />

        <bean id="marshaler"
class="com.sungard.decalog.servicemix.jms2mail.MyConsumerMarshaler">
                <property name="mep" 
value="http://www.w3.org/2004/08/wsdl/in-only"; /> 
        </bean> 
        
The MyConsumerMarshaller class extends DefaultConsumerMarshaler and
overrides the populateMessage() method to accept plain (non XML) message
payloads.


The eip service definition (doesn't do much for now):

        <eip:static-recipient-list service="jms2mail:pipeline" 
endpoint="endpoint">
                <eip:recipients>
                        <eip:exchange-target service="jms2mail:mail" 
endpoint="endpoint" />
                </eip:recipients>
        </eip:static-recipient-list>


The mail service definition:

        <mail:sender service="jms2mail:mail" 
              endpoint="endpoint"
              sender="${mail.sender}"
              receiver="${mail.receiver}"
              connection="${mail.connection}" >

        <mail:ignoreMessageProperties>
           <value
type="java.lang.String">org.apache.servicemix.mail.to</value>
           <value
type="java.lang.String">org.apache.servicemix.mail.bcc</value>
           <value
type="java.lang.String">org.apache.servicemix.mail.cc</value>
        </mail:ignoreMessageProperties>

        </mail:sender>

        
My question is how would one achieve a robust in only Jms to mail bridge
without reply messages.

Regards,
Philippe.




-- 
View this message in context: 
http://old.nabble.com/How-to-create-a-robust-Jms-to-mail-bridge-tp28655521p28655521.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to