camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Geidel <joachim.gei...@bluecarat.de>
Subject xstream marshaling produces null result
Date Thu, 21 Feb 2008 11:18:45 GMT

A friend and I are new to Camel, and we are trying to figure out how it works
and what we can do with it. We ran into a problem when using xstream for
marshaling. We start with XML file input, unmarshal it, change the Java
object, marshal it, and store it in a destination queue. This looks exactly
like one of the Camel test cases, except that the order of marshal/unmarshal
is reversed. However, the message body is null after marshaling.

We have used Camel 1.3.0 from the FUSE download. This is our code, stripped
to the essentials:

----

public class WGRUSRouteBuilder extends SpringRouteBuilder {

        @Override
        public void configure() {

                from("file:data/input?noop=true")
                        .unmarshal().xstream()
                        .process(new Processor() {
                                public void process(Exchange exchange)
throws Exception {
                                        System.out.println("Processor: " +
exchange.getIn());
                                }
                        })
                        .marshal().xstream()
                        .process(new Processor() {
                                public void process(Exchange exchange)
throws Exception {
                                        System.out.println("Processor: " +
exchange.getIn());
                                }
                        
                        })
                        .to("mock:result");
        }
}
----

Unmarshaling creates a Java object as expected, but the second println shows
that marshaling doesn't set the message body to an XML string as we had
expected. Did we miss something, or is it a bug?

Thanks in advance,
Joachim Geidel

-- 
View this message in context: http://www.nabble.com/xstream-marshaling-produces-null-result-tp15607283s22882p15607283.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message