Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 85866 invoked from network); 30 Oct 2008 12:10:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2008 12:10:51 -0000 Received: (qmail 83734 invoked by uid 500); 30 Oct 2008 12:10:55 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 83633 invoked by uid 500); 30 Oct 2008 12:10:55 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 83577 invoked by uid 99); 30 Oct 2008 12:10:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 05:10:55 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of james.strachan@gmail.com designates 74.125.46.156 as permitted sender) Received: from [74.125.46.156] (HELO yw-out-1718.google.com) (74.125.46.156) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 12:09:38 +0000 Received: by yw-out-1718.google.com with SMTP id 6so173957ywa.86 for ; Thu, 30 Oct 2008 05:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ZgCtY0aYx631cfg0vF30rwoTaK8NHC/JYJbgEBZlgw0=; b=j2hi2sC1mLJ4GgVQAxP+fsHmt/qAPS5YM1XWLNrUULzwtOgRzrdeqx/8IqKRxo92ny bNK03AHYz4YdEIamIFDhHm4qxU4rA4sT3RJmPRTWQgyOedSVkckXNuAUo0ZGvOjX5ACt 9u8ocb7oPZqt1bqxnI262gKXmTfBkYEZ+8Cdk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=mcEyDaXM0FQu0gThMuWrEtABs3DtNn138e8zC1E1y7o+c9T+vLB/viHfioBDARa5BF yY42WHGObLM4etyaYYcpgwT94B3CXcf9ZtxXo3G9PmMK0q858M7VXXzInQy10iY51FKy 6goq0z/yQEFcoPdweS+Aad21orLH6llGTxJFM= Received: by 10.90.29.17 with SMTP id c17mr8667368agc.13.1225368618272; Thu, 30 Oct 2008 05:10:18 -0700 (PDT) Received: by 10.90.117.12 with HTTP; Thu, 30 Oct 2008 05:10:18 -0700 (PDT) Message-ID: Date: Thu, 30 Oct 2008 12:10:18 +0000 From: "James Strachan" To: users@activemq.apache.org Subject: Re: Empty message body of type List in a Queue Cc: camel-user@activemq.apache.org In-Reply-To: <20243979.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20243979.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org 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 : > > 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: > > > xmlns="http://activemq.apache.org/camel/schema/spring"> > com......connector.sap > > > 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 = > org.apache.activemq.util.ByteSequence@154c054, 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/