Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EEC6B17241 for ; Mon, 7 Sep 2015 11:05:51 +0000 (UTC) Received: (qmail 62647 invoked by uid 500); 7 Sep 2015 11:05:51 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 62600 invoked by uid 500); 7 Sep 2015 11:05:51 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 62588 invoked by uid 99); 7 Sep 2015 11:05:51 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2015 11:05:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 1431FC0252 for ; Mon, 7 Sep 2015 11:05:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.821 X-Spam-Level: X-Spam-Status: No, score=-0.821 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id tash3U4fr1lZ for ; Mon, 7 Sep 2015 11:05:50 +0000 (UTC) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id A975742B13 for ; Mon, 7 Sep 2015 11:05:49 +0000 (UTC) Received: by wicfx3 with SMTP id fx3so79996543wic.0 for ; Mon, 07 Sep 2015 04:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=jULuJsW1hjOdvHR06suyU2tFCsx5DWyyN/ueXG9tkeo=; b=bNgnPtbeNCDfowSyzS94xhvZ3mZ00PlIaa+UxHWk7fPWoJhNH/nGGG9ML4sWM1UKJP Bubhs4KwWxJW2OQUJIbLbRgHy0PSrH5GUFJPf2W2csmQtd3r0Ay9u8dqL6QRvUlS9Jif zYdNIbH2b1t8udvqsesSIe7pNKkuiypk9kWksOHDmCJ5pUZ/b6TKCQLSLhKY5y57j5t6 AaJs3uy7h7qwm0ryJTT79j8TM755G+YK7ic7Cfzbq+TDpVjnniERWf0QUZV4OD23WSY5 X0ivfo4n9DEiimhmoI29QDLPMZnrlXf8lbOHKzKDiPBI4Pw/fmFEvQ0ZOGD/LJAhCsCV 9Xig== X-Received: by 10.180.219.101 with SMTP id pn5mr32298163wic.89.1441623948643; Mon, 07 Sep 2015 04:05:48 -0700 (PDT) Received: from [10.36.226.3] ([80.169.137.63]) by smtp.googlemail.com with ESMTPSA id m4sm19413301wjb.37.2015.09.07.04.05.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 04:05:47 -0700 (PDT) Subject: Re: Camel Transport and CXF : where to convert response Date headers To: dev@camel.apache.org References: <4C1FB9DC-7056-4165-A96D-F693E3E3C7D0@apache.org> <46647C99-EB30-44CF-AFFE-F2B66813F7F3@apache.org> <5422CB70.7000203@gmail.com> <1411854681913-5757113.post@n5.nabble.com> <54B946A7.80206@gmail.com> <55D59883.1010705@gmail.com> From: Sergey Beryozkin Message-ID: <55ED6F8B.1090601@gmail.com> Date: Mon, 7 Sep 2015 12:05:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, sorry, looks like I forwarded the old message, I send the one recently with https://issues.apache.org/jira/browse/CAMEL-9105?focusedCommentId=14727571&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14727571 CAMEL-9105 has a patch and CAMEL-9091 I linked to below is already closed as a duplicate. I noted in CAMEL-9105 that the patch converts Date/Locale locally by default - this can be restricted to 2.16.0 only if preferred or disabled by default - just a matter of changing a default value to 'false' (see the patch) everywhere or only on the non-trunk branches. Have a look please Cheers, Sergey On 07/09/15 11:48, Claus Ibsen wrote: > Hi > > Yeah sure it sounds reasonable to convert java.util.Date headers to a > HTTP friendly string representation in the general http binding. You > are imho welcome to work on a patch for that. > > Mind that on master branch there is a camel-http-common module, where > the binding is. > > > > On Thu, Aug 20, 2015 at 11:06 AM, Sergey Beryozkin wrote: >> Hi All >> >> In CXF the response headers which have java.util.Date values converted at >> the HTTP transport level into HTTP-friendly representations. >> When CXF (JAX-RS) endpoints are integrated into Camel routes using Camel >> Transport, example: >> >> > address="camel://direct:HelloWorldRestServerEndpoint"> >> >> >> >> >> >> >> >> >> >> >> >> the response Date headers, if available, get converted to String by the >> global Camel type converter at the DefaultHttpBinding (camel http common) >> level. >> >> I opened with a patch attached. The idea there is that Date headers coming >> out of CXF get converted to HTTP format Strings at the Camel to/from CXF >> integration level. >> >> I think there might be a bit of sensitivity associated with such a fix, as >> one can imagine a non-HTTP consumer that links to CXF via Camel Transport. >> I.e, the question is what if, when a CXF response header contains a Date >> instance, the default Date.toString() is desired ? >> >> I think it is somewhat unlikely however, assuming the patch [1] gets >> accepted, the following options are available to CXF services which are >> linked to with Camel Transport: >> - do Date.toString() at the CXF level - the simplest option >> - the patch [1] introduces a Camel exchange property that would let Date >> headers propagated unchanged back to Camel >> >> I think this is reasonable and covers all the variations. >> However if someone thinks this is not perfect then the alternative is to >> drop [1] but re-implement a similar solution at DefaultHttpBinding level: >> - if it is a response header with a Date value then convert it inside >> DefaultHttpBinding to the HTTP friendly format - it is difficult to imagine >> why a non-HTTP format would be required at the point of returning Dates to >> the external HTTP clients. >> - Add the option to let users delegate Date to String conversions to Camel >> to the type converters if really needed >> >> To summarize I think a patch at [1] offers a flexible solution for users >> doing a Camel CXF integration with Camel transport. >> If it is not accepted then I can do a patch against DefaultHttpBinding as >> suggested above - perhaps that can be useful to non-CXF users too >> >> Let me know please >> Sergey >> >> >> >> >> >> >> [1] https://issues.apache.org/jira/browse/CAMEL-9091 >> >> > > >