Hi I suggest to convert the message to a String beforehand.
Just add <convertBodyTo type="String"/> before the JMS endpoint. Another alternative is to tell the JMS endpoint that it should be a Text message (which will force Camel to convert the message to a String under the covers). Then you do not need the <convertBodyTo/> but just set the option jmsMessageType=Text in the endpoint uri. You can read about this option here: http://camel.apache.org/jms On Wed, Jan 11, 2012 at 7:46 AM, Nicolas Gapaillard <[email protected]> wrote: > Hi all, > > I succeed to send an imap message from camel to activemq. But I have a > problem, I have all information except the body. > > My camel configuration inside activeMQ: > > <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> > <jmxAgent id="agent" disabled="true"/> > <route> > <from uri="imaps:// > [email protected]&password=xxxxxxx&delete=false&unseen=true" > /> > <to uri="activemq:Q1.mail" /> > </route> > </camelContext> > > <!-- configure the camel activemq component to use the current broker --> > <bean id="activemq" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="connectionFactory"> > <bean class="org.apache.activemq.ActiveMQConnectionFactory"> > <property name="brokerURL" > value="vm://localhost?broker.persistent=false&broker.useJmx=false"/> > </bean> > </property> > </bean> > > From activemq side I have this message when I consume the email from the > imap server : > > 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 > java.io.Serializable, or you can force a specific type by setting the > jmsMessageType option on the JMS endpoint. > > I guess the object javax.mail.internet.MimeMultipart sent by camel is not > serializable. > The message I receive in my JMS client: > > ActiveMQMessage {commandId = 5, responseRequired = true, messageId = > ID:plop-laptop-42681-1326258465826-2:1:1:1:1, originalDestination = null, > originalTransactionId = null, producerId = > ID:plop-laptop-42681-1326258465826-2:1:1:1, destination = queue://Q1.mail, > transactionId = null, expiration = 0, timestamp = 1326258534134, arrival = > 0, brokerInTime = 1326258534135, brokerOutTime = 1326258534159, > correlationId = null, replyTo = null, persistent = true, type = null, > priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, > compressed = false, userID = null, content = null, marshalledProperties = > org.apache.activemq.util.ByteSequence@1ebf1eb, dataStructure = null, > redeliveryCounter = 0, size = 0, properties = > {Authentication_HYPHEN_Results=mr.google.com; spf=pass (google.com: domain > of > [email protected] designates 10.224.31.202 as permitted sender) > [email protected]; dkim=pass > [email protected], Return_HYPHEN_Path=<[email protected]>, > MIME_HYPHEN_Version=1.0, Message_HYPHEN_ID=< > cajef+7teg9e9-osuch+oze+guznijvvm7pfcyntqp-yr9y2...@mail.gmail.com>, > Content_HYPHEN_Type=multipart/alternative; > boundary=20cf3074b14c4bc59604b639a0c8, Date=Wed, 11 Jan 2012 06:08:45 > +0100, Subject=mail de test, [email protected], > [email protected], From=Plop <[email protected]>, > DKIM_HYPHEN_Signature=v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; > s=gamma; > h=mime-version:date:message-id:subject:from:to:content-type; > bh=tDZGQ2Ys4OH/ioEN81r3vKi/8ccflSm+mOzJ5phR/eU=; > b=iWW9RdyTl6EL7q4vnHtrOlBGEhmDgTjdoed4bdxEPdTboLeNQGPsmR5BIDKT1ZxOse > oQHpVKxt8PJFPP7MkOlyveumuiiXo+VJr3Z8rso2ZRJyEzU5CIOfXnv89Mvk1Z50UfGB > YyuRbavP8ZYd47aGZHlKIzEhjwGLfRDDSycwk=, Received_HYPHEN_SPF=pass ( > google.com: domain of [email protected] > designates 10.224.31.202 as permitted sender) client-ip=10.224.31.202;}, > readOnlyProperties = true, readOnlyBody = true, droppable = false} > > > > How can I do to fix or work around this problem between camel and activemq > ? If someone has an idea. > > Thank you for your help. > > -- > Nicolas Gapaillard > [email protected] -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
