camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Langevin" <>
Subject camel-mail IMAP mime-multipart splitAttachment
Date Thu, 07 Dec 2017 18:55:10 GMT

i try to implement a MAIL service In OSGI Karaf 4.0.9  with Camel 2.17.7, Camel-Mail and Active-MQ
and SQL
i want to read MAIL from IMAP server, then keep It into JMS Queue an then process each mail
with mime-multipart with attachment and insert it into sql database

I stuck at the first Step process read MAIL and insert it into JMS.

My Case.
I have a MAIL with 2 attachments, i read the MAIL, split it into 2 messages into JMS Queue,
 each message have a diiferent CamelSplitAttachment Id, corresponding the name of the attachment
but i don't have the content of my MAIL or of my attachment

The body of each split contain: 

Unknown message type [org.apache.activemq.command.ActiveMQMessage] ActiveMQMessage {commandId
= 5, responseRequired = true, messageId = .....

I think i'm the good track, do you have an idea, what is missing ?

Only one error/warning in the log message:
JmsBinding                          | 46 - org.apache.camel.camel-jms - 2.17.7 | Cannot determine
specific JmsMessage type to use from body class. Will use generic JmsMessage. Body class:
javax.mail.internet.MimeMultipart. If you want to send a POJO then your class might need to
implement, or you can force a specific type by setting the jmsMessageType
option on the JMS endpoint.



Here is my bundle.

<beans xmlns=""


    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="connectionFactory" >
          <bean class="org.apache.activemq.ActiveMQConnectionFactory">
             <property name="userName" value="${activemq.jms.user}"/>
             <property name="password" value="${activemq.jms.password}"/>

<camelContext xmlns="" trace="false">

<route id="route.UTL.Imap">
 <from uri="direct:UTL.IMAP"/>
 <from uri="imaps://servername:993?username=xxxxxxxxxxxx&amp;password=xxxxxxxxxxx&amp;delete=true&amp;unseen=true&amp;consumer.delay=20000"
    <method beanType="org.apache.camel.component.mail.SplitAttachmentsExpression"/>
    <to uri="mock:split" />
    <to uri="activemq:queue:jms/SDI/courrielSystemeSHQ/reception/queue" />
 <log message="*** MAIL RECEIVE ${body} ***"/>

"Le présent courriel peut contenir des renseignements confidentiels et ne s'adresse qu'au
destinataire dont le nom apparaît ci-dessus. Si ce courriel vous est parvenu par mégarde,
veuillez le supprimer et nous en aviser aussitôt."

View raw message