camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" <claus.ib...@gmail.com>
Subject Re: XStream and ActiveMQ component
Date Tue, 02 Dec 2008 12:41:53 GMT
Hi Martin

I had the same problem with IBM WebSphere MQ. Here is a route I
created for a POC so I could browse the XML in WebSphereMQ:

Hint: use convertBodyTo(String.class)


      from("gsoQueue")
            // map the input from GS to our inhouse format
            .processRef("mapper")
            // marhsal the inhouse format to a xml stream and as a
string so we can browse
            // it on the queue (xstream is default byte arrays)
            .marshal().xstream().convertBodyTo(String.class)
            .to("inhouseQueue");

        from("inhouseQueue")
            // from the skygge queue unmarshal back from xml to our
domain model objects
            .unmarshal().xstream()
            // process it by our own processor where we can do in java
what we want
            // and we want to update the database
            .processRef("skyggedb");


/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/



On Tue, Dec 2, 2008 at 1:13 PM, Martin Gilday <martin.lists@imap.cc> wrote:
> I am placing messages onto ActiveMQ through Camel and using the XStream
> component to marshal to XML.  However when I look in the ActiveMQ admin
> panel I can see that the messages are there but the body looks empty.
> When I consume the messages and use unmarshal and pass to a bean ref
> then the body is correctly recieved.  Searchs of the mailing list show
> cases where the body is null, but as I can later unmarshal this can't be
> the case here.  Is there any reason why ActiveMQ would not be able to
> display my XML message bodies?  When using marshal does it send the body
> as BytesMessage or TextMessage?
>
> Thanks,
> Martin.
>

Mime
View raw message