BTW the Camel user lists is a better place for this http://activemq.apache.org/camel/discussion-forums.html
(I've CC'd them) 2008/10/30 Schneider <[EMAIL PROTECTED]>: > > Hi ActiveMQ forum, > > we are new to ActiveMQ and we have a problem (or a misunderstanding) with > messages having an object in the body instead of text (String). It seems > that the message body is not stored in the queue if it is of type List or > Map instead of String. > > We are using: ActiveMQ 5.1, persistence queues on Windows XP Pro SP 2, JVM > 1.6_10. > > Our routes are defined in a package given via activemq.xml: > > <!-- http://activemq.apache.org/enterprise-integration-patterns.html --> > <camelContext id="camel" > xmlns="http://activemq.apache.org/camel/schema/spring"> > <package>com......connector.sap</package> > </camelContext> > > In this package we have to RouteBuilders which defines the two following > routes: > > public void configure() throws Exception { > FlatpackDataFormat df = new FlatpackDataFormat(); > df.setDefinition(new > ClassPathResource("definition.pzmap.xml")); > df.setFixed(false); > df.setIgnoreFirstRecord(false); > df.setDelimiter(';'); > > from("file://C:/ftproot/in?delete=true") > .unmarshal(df) > .convertBodyTo(List.class) > .to("activemq:import.text"); > } > > and > > public void configure() throws Exception { > from("activemq:import.text") > .process(new SimpleTextMessageProcessor()); > } > > The SimpleTextMessageProcessor.process is like this: > > public void process(Exchange exchange) throws Exception { > Logger logger = > Logger.getLogger("com.transporeon.norskeskog.connector.sap"); > logger.debug("ENTRY: SimpleTextMessageProcessor.process"); > > Message in = exchange.getIn(); > logger.debug("IN message: " + in); > logger.debug("IN body: " + in.getBody()); > } > > Here we are missing the body of the message which is null as the log of the > ActiveMQ console shows: > > DEBUG sap - ENTRY: > SimpleTextMessageProcessor.process > DEBUG sap - IN message: JmsMessage: > ActiveMQMessage {commandId = 5, responseRequired = true, messageId > = ID:PC038-2832-1225357029453-2:1:1:1:1, originalDestination = null, > originalTransactionId = null, producerId = ID:PC038-2832-1225 > 357029453-2:1:1:1, destination = queue://import.norskeskog.text, > transactionId = null, expiration = 0, timestamp = 1225357033015, > arrival = 0, brokerInTime = 1225357033015, brokerOutTime = 1225357033031, > correlationId = null, replyTo = null, persistent = true, > type = null, priority = 4, groupID = null, groupSequence = 0, > targetConsumerId = null, compressed = false, userID = null, content > = null, marshalledProperties = > [EMAIL PROTECTED], dataStructure = null, > redeliveryCounter = 0, size = > 0, properties = null, readOnlyProperties = true, readOnlyBody = true, > droppable = false} > DEBUG sap - IN body: null > > If we do not convert the Body to a List the body is not missing. But we > would like to have objects in our messages. > > We know the class ObjectMessage which maybe the solution for our problem, > but not sure how to use this class in our context. > > So, our quesition is how we can store objects in messages which are send to > persistence message queues in ActiveMQ? > > Many thanks for your time! > Schneider > -- > View this message in context: > http://www.nabble.com/Empty-message-body-of-type-List-in-a-Queue-tp20243979p20243979.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- James ------- http://macstrac.blogspot.com/ Open Source Integration http://fusesource.com/
