camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From icucode <>
Subject Missing attachments
Date Mon, 19 Jan 2009 11:54:15 GMT


I'm trying to send attachments attached to the message that is sent to the
queue but they seem to vanish on the way for some reason; because on the
consumer side they no longer exist.

== producer ==
public static void sendMessageInOnly(File attachment)
   Endpoint endpoint = camel.getEndpoint(address);
   Exchange exchange = endpoint.createExchange(ExchangePattern.InOnly);

   exchange.getIn().addAttachment(attachment.getName(), new DataHandler(new
   Producer producer = endpoint.createProducer();
Note: attachment is valid and everything seems ok on the producer side.

== Consumer ==
public void process(Exchange exchange) throws Exception
   System.out.println("Recieved message...");
   System.out.println("Message has attachments: " +
Note: hasAttachments() returns false.

public class ConsumerRoute extends RouteBuilder
    public void configure() throws Exception
        from("jms:queue:jobs").process(new JobConsumer());

In the debug output from the consumer, attachments aren't even listed -
only; Pattern, Headers, BodyType and Body. In the headers section there are
only JMS specific properties. How can I fetch the attachments if
getAttachments() isn't the right way?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message