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 E9CA1200CA3 for ; Thu, 1 Jun 2017 15:34:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E8A53160BC4; Thu, 1 Jun 2017 13:34:55 +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 139EE160BB5 for ; Thu, 1 Jun 2017 15:34:54 +0200 (CEST) Received: (qmail 48330 invoked by uid 500); 1 Jun 2017 13:34:54 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 48319 invoked by uid 99); 1 Jun 2017 13:34:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jun 2017 13:34:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9072A182883 for ; Thu, 1 Jun 2017 13:34:53 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.48 X-Spam-Level: *** X-Spam-Status: No, score=3.48 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LIVE=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id TbqZMFwR4P6D for ; Thu, 1 Jun 2017 13:34:50 +0000 (UTC) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id E90195F5B4 for ; Thu, 1 Jun 2017 13:34:49 +0000 (UTC) Received: by mail-it0-f46.google.com with SMTP id r63so35235212itc.1 for ; Thu, 01 Jun 2017 06:34:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=CYWAGc0lYMkQCE+doD/gBUf+vKrWq9b0cAR4+orwBnk=; b=TBjQRdpISHwp3LqDbXBfuk1uf6pEqT/sc9yy7xqUqMFNF4o6TNN6xjVMSHqTn2EsDt 0bVGcID8h1hvtG0laQCxJjhzcnO6jSoqUAY+V3iqAOR5XGkWNqIdHPDSWMQZ/EEoCaou F1pgqlDadGfCaHlAc5kr/VXQEpEV/7GkNhuv3KKGw2+501hES68oUCf1+7kQgfTZM0Lc XYGEefB2x3jh/krTaa2oXxE9A1eLCjBAubd7kun/aU7SHXCByqBvoJaLRYzYcqkmzIyG AZqh8jk/x6YhkBOiyLfEMzeboXSxNFH0Io74CyormMHNU67O04VTRA1sCZkHLWn+2lRf lFeA== X-Gm-Message-State: AODbwcB7xcRPGy78oXz84E4lp3oGqDsbvv0tVUGZ735rjXng0GqrI36i BDN0v+i2vqt8WEpQZtneKclDBEXmIkTlRSo= X-Received: by 10.36.29.150 with SMTP id 144mr13270032itj.71.1496324088050; Thu, 01 Jun 2017 06:34:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.163.133 with HTTP; Thu, 1 Jun 2017 06:34:47 -0700 (PDT) In-Reply-To: <2c47d851-da37-1277-2699-0451df93fbe6@gmail.com> References: <95C56966-F848-47A0-B587-9F0E9AAE06F9@me.com> <1D42C4DB-B265-40FA-8C50-80423BC81289@gmail.com> <984A9C1D-72E2-4B62-965C-374C407A45EB@me.com> <81F7E4E3-3C95-41C4-A81C-A984F5A004D5@me.com> <943F83FE-20A4-42C7-B218-9307986DB43B@me.com> <60F6BF2D-DF79-4C73-BB8B-B3396FA092FC@me.com> <592F37A1.9020500@gmail.com> <9FA3393F-16B3-4E1F-A692-749B42F180B6@me.com> <2c47d851-da37-1277-2699-0451df93fbe6@gmail.com> From: Martyn Taylor Date: Thu, 1 Jun 2017 14:34:47 +0100 Message-ID: Subject: Re: [DISCUSS] Custom Object Serialisation Support To: dev@activemq.apache.org Content-Type: multipart/alternative; boundary="001a11436faebcfb920550e61922" archived-at: Thu, 01 Jun 2017 13:34:56 -0000 --001a11436faebcfb920550e61922 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jun 1, 2017 at 2:32 PM, Timothy Bish wrote: > On 06/01/2017 08:51 AM, Martyn Taylor wrote: > >> I get the use case for using JSON/XML, particularly for cross language >> communication. >> >> One way users get around this problem right now is just to serialize >> to/from XML/JSON at the client application level and just use JMS >> TextMessages to send the data. I guess the idea here to remove that >> complexity from the client application and into the client via these >> pluggable serializer objects? Removing the serizliation logic out of co= de >> and into configuration. >> >> Providing I've understood this properly, it seems like a good idea to me= . >> so +1. >> > > This problem has already been solved via frameworks like Apache Camel, > putting such complexity into the JMS client is solving a problem that's > already been solved and in much more flexible and configurable ways. Thanks Tim. I am not a Camel expert in any shape or form, how much additional complexity/configuration would be required to do something similar with Camel? My understanding of the proposal here is really just to give control back to the user in terms of how their objects are serialized. I'd expect this to be pretty light weight, just allow a user to configure a class to do the serialization. > >> On Thu, Jun 1, 2017 at 7:44 AM, Michael Andr=C3=A9 Pearce < >> michael.andre.pearce@me.com> wrote: >> >> I think i might be getting the problem, use case you want to go for, whi= ch >>> is to possible serialise to JSON or XML, because they're supported well >>> in >>> other languages like c++, which won't read a java serialised object, an= d >>> say for XML you generate objects via an XSD which by default aren't >>> serialisable, so you cannot simply add Serializable to the object, as i= ts >>> generated at build. >>> >>> Is this the problem we need to solve? If so: >>> >>> To get around this normally the tools that generate objects for >>> serialisation from schema such as XSD do support a way to toggle or >>> change >>> the generation slightly for some common use cases. >>> >>> In case of XSD, where using jaxb it would be to add something like the >>> below to jaxb global bindings: >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> like wise if you are generating POJO's from a jsonschema using for say >>> the >>> tool jsonschema2pojo there is a toggle in the maven plugin serializabl= e >>> which you can switch to true. >>> >>> Obviously if you hand crank your DTO Pojo's then it's a case of simply >>> add >>> implement Serializable to the class. >>> >>> Cheers >>> Mike >>> >>> Sent from my iPhone >>> >>> On 1 Jun 2017, at 06:57, Michael Andr=C3=A9 Pearce < >>>> >>> michael.andre.pearce@me.com> wrote: >>> >>>> we could but then it wouldn't work via jms api. Typically if using jms >>>> >>> the only custom or specific broker object is the connection factory the >>> rest you code to Jms. >>> >>>> >>>> >>>> Sent from my iPhone >>>> >>>> On 1 Jun 2017, at 04:10, Clebert Suconic >>>>> >>>> wrote: >>> >>>> On Wed, May 31, 2017 at 10:47 PM Michael Andr=C3=A9 Pearce < >>>>> michael.andre.pearce@me.com> wrote: >>>>> >>>>> Jms api dictates class set in object message to be serializable. >>>>>> >>>>> >>>>> We could make an extension. It could be an extra message this actuall= y. >>>>> >>>>> >>>>>> >>>>>> On 31 May 2017, at 22:37, Timothy Nodine >>>>>>> >>>>>> wrote: >>> >>>> Should the interface require the underlying class to be Serializable? >>>>>>> >>>>>> One use case might be to provide serialization to classes that aren'= t >>>>>> natively serializable. >>>>>> >>>>>>> >>>>>>> >>>>>>> Michael Andr=C3=A9 Pearce wrote: >>>>>>> >>>>>>>> To help discussion, >>>>>>>> A very very basic implementation just to simulate the idea. >>>>>>>> >>>>>>> https://github.com/michaelandrepearce/activemq-artemis/tree/ >>>>>> >>>>> CustomSerialisation >>> >>>> < >>>>>> https://github.com/michaelandrepearce/activemq-artemis/tree/ >>>>>> >>>>> CustomSerialisation >>> >>>> n.b. doesn=E2=80=99t fully compile is just pseudo impl, nor doesn=E2= =80=99t include >>>>>>>> >>>>>>> bits as discussed below like map/change type to a byte message for >>>>>> compatibility, nor media type idea. >>>>>> >>>>>>> Cheers >>>>>>>> Mike >>>>>>>> >>>>>>>> -- >>>>> Clebert Suconic >>>>> >>>> > > -- > Tim Bish > twitter: @tabish121 > blog: http://timbish.blogspot.com/ > > --001a11436faebcfb920550e61922--