Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E6F74200BF2 for ; Mon, 2 Jan 2017 09:44:42 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DAF8B160B30; Mon, 2 Jan 2017 08:44:42 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 30335160B21 for ; Mon, 2 Jan 2017 09:44:42 +0100 (CET) Received: (qmail 61171 invoked by uid 500); 2 Jan 2017 08:44:36 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 61157 invoked by uid 99); 2 Jan 2017 08:44:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2017 08:44:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4B7001A0682 for ; Mon, 2 Jan 2017 08:44:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.486 X-Spam-Level: *** X-Spam-Status: No, score=3.486 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URI_HEX=1.313] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id SX5faNiUi7cg for ; Mon, 2 Jan 2017 08:44:34 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id B053D5FDC9 for ; Mon, 2 Jan 2017 08:44:33 +0000 (UTC) Received: from static.162.255.23.22.macminivault.com (unknown [162.255.23.22]) by mbob.nabble.com (Postfix) with ESMTP id 12836395B4C8 for ; Mon, 2 Jan 2017 00:28:54 -0800 (PST) Date: Mon, 2 Jan 2017 01:44:25 -0700 (MST) From: "barbara.devid" To: users@camel.apache.org Message-ID: <1483346665518-5792049.post@n5.nabble.com> Subject: Serializable headers lost by JmsBinding MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit archived-at: Mon, 02 Jan 2017 08:44:43 -0000 Hi, I search for this topic but could not find anything, so if it is a duplicate I'm sorry. In Apache Camel 2.0.15 I was able to set serializable objects in message headers and send them through activemq queues without loose them. In order to obtain this I had to set the "transferExchange=true" option on both producer and consumer. Also I put the JVM options -Dorg.apache.activemq.SERIALIZABLE_PACKAGES=\"*\" Now I migrate to Apache Camel 2.0.17 and all my serializable headers are lost. I debugged the code and notice that: the class org.apache.camel.component.jms.JmsBinding in camel-jms has not change its behavior, but a class in camel-core did! The class is org.apache.camel.impl.DefaultExchangeHolder . In Camel 2.0.15 it had two marshal methods, static DefaultExchangeHolder marshal(Exchange exchange) static DefaultExchangeHolder marshal(Exchange exchange, boolean includeProperties) the first one just invoke the second one setting "includeProperties=true" Now, in 2.0.17, the marshal methods are 3. Besides the old ones there is this new method static DefaultExchangeHolder marshal(Exchange exchange, boolean includeProperties, boolean allowSerializedHeaders) The problem seems to be that marshal(Exchange exchange) now calls this new method setting "allowedSerializedHeaders=false" . Also the marshal(Exchange exchange, boolean includeProperties) invoke the methods "safeSetInHeaders" and "safeSetOutHeaders" setting the allowSerializeHeaders parameter to false. Can you please tell me if in newer version of Apache Camel the code has changed to fix this problem? I cannot try it out, but maybe the camel-jms class JmsBinding should be changed to call the 3 parameter marshal method this way: protected Message *createJmsMessage*(Exchange exchange, Object body, Map headers, Session session, CamelContext context) throws JMSException { if(this.endpoint != null && *this.endpoint.isTransferExchange()*) { LOG.trace("Option transferExchange=true so we use JmsMessageType: Object"); DefaultExchangeHolder answer2 = DefaultExchangeHolder.marshal(exchange); <---- THIS LINE TO: *DefaultExchangeHolder.marshal(exchange, true, true);* ObjectMessage answer1 = session.createObjectMessage(answer2); ... Since we have several serailizable headers in our routes, for the moment we will remain on 2.0.15 version, yet It would be great to be able to upgrade to newer releases. Thank you Barbara -- View this message in context: http://camel.465427.n5.nabble.com/Serializable-headers-lost-by-JmsBinding-tp5792049.html Sent from the Camel - Users mailing list archive at Nabble.com.