camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From harpritt <harpr...@hotmail.com>
Subject Re: Problem with FileComponent
Date Tue, 21 Oct 2008 08:56:17 GMT

Hi James

ive had a look around but cant seem to find any information on the
equivellent solution using XML.

im very new to this so appologies if i asked a dum question

Kind regards



James.Strachan wrote:
> 
> On 18/01/2008, Christian Schneider <chris@die-schneider.net> wrote:
>>
>> I just found a solution by using:
>> from(SOURCE).convertBodyTo(String.class).to("jms:test.queue");
>> from("jms:test.queue").process(new Processor() {
>>   public void process(Exchange exchange) throws Exception {
>>     Object body = exchange.getIn().getBody();
>>   }
>> });
>>
>> Is this the correct way to do this?
> 
> Currently yes. One of the problems with Camel components is that they
> often have to deal with any type of Object as the payload. Right now
> the JMS binding tries to do the right thing; if the payload is a
> String it uses a TextMessage otherwise it uses an ObjectMessage.
> 
> We should probably improve the type support in the JMS binding to deal
> nicer with File objects.
> 
> Though given a File object, normally the binding would have to use a
> BytesMessage as it would not be sure the file is actually text; so if
> you really want to send a TextMessage then I'd recommend leaving your
> "convertBodyTo(String.class)" in the DSL
> 
> I've raised a JIRA to track this issue...
> https://issues.apache.org/activemq/browse/CAMEL-299
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> Open Source Integration
> http://open.iona.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-FileComponent-tp14961883s22882p20086088.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message