-
1. Re: Can't retrive message body
mvackel Sep 25, 2009 5:55 PM (in response to mvackel)This problem happens if the provider is a FileSystem (FS Provider). If so, to retrive the message, use something like:
System.out.println("Body: "+ new String( (byte[]) msg.getBody().get() ) );
BUT, if the provider is a JMS provider, use something like this:
System.out.println("Body: " + new String((String) msg.getBody().get()));
in this last case, if you use the former version, it issues an exception. WHY are the message bodies differente? -
2. Re: Can't retrive message body
kconner Sep 28, 2009 5:16 AM (in response to mvackel)The default composer for the filesystem retrieves the contents and stores them in the message as a byte[]. This can easily be changed however, if you know that the contents are string rather than binary.
The default composer is LocalFileMessageComposer but you can add a property within the fs-listener element to override it.<fs-listener ...> <property name="composer-class" value="XXX"/> </fs-listener>