users@jersey.java.net

[Jersey] Re: Jackson vs. MOXy

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Wed, 18 Dec 2013 15:08:47 -0500

However... Jersey should correct their documentation. Pointing users in
the wrong direction doesn't help anybody.

Gili

On 18/12/2013 12:38 PM, Robert DiFalco wrote:
> Thanks for the great explanation. FWIW, I think you are doing too much
> work on your Jackson integration. For example, the code you provide is
> tied to 1.9 which has different package paths. Fortunately, Jackson
> provides what is needed and you only need to instruct users to include
> the jackson json provider jar. Nothing else is needed on the Jersey
> end.
>
> On Wed, Dec 18, 2013 at 9:28 AM, Marek Potociar
> <marek.potociar_at_oracle.com> wrote:
>> We advertise MOXy as the recommended default, because it can support both
>> JSON and XML as well as full set of JAXB annotations and more goodies (e.g.
>> externalized bindings etc.). IOW, you can code your data model POJOs once
>> and have them exposed as both JSON and XML for free. MOXy is also by default
>> available in GlassFish and WebLogic, so you do not need to install any
>> additional libraries in these app servers.
>>
>> That said, you can use Jackson if you prefer it for some reason. Here's how:
>> https://jersey.java.net/documentation/2.4.1/media.html#json.jackson
>>
>> As for other goodies, MOXy has a lot of extra features. From those directly
>> related to Jersey, for example we currently support entity filtering with
>> MOXy JSON providers. (To be fair, this is something we would like to support
>> with Jackson too, sometime soon.)
>>
>> Performance-wise, our internal tests indicate that Jackson is slightly
>> faster at the moment. However, as soon as real network calls are involved,
>> the performance difference is marginal. In general, you want to worry about
>> design of your REST services wrt. latency caused by network and database
>> communication; small server-side processing performance differences are
>> irrelevant (as long as the server is scalable).
>>
>> Marek
>>
>> On 13 Dec 2013, at 22:41, Robert DiFalco <robert.difalco_at_gmail.com> wrote:
>>
>> I'm migrating from Jersey 1.9 to 2.x. Wow, what a lot of odds and ends to
>> relearn. It looks like Moxy is preferred over Jackson (which I use in other
>> parts of my code). I can make this change but before I do I have some
>> questions:
>>
>> 1. Why is MOXy the "preferred" approach for Jersey 2.x?
>> 2. Why was it selected over Jackson?
>> 3. Have there been any speed comparisons between Moxy and Jackson for
>> POJO mapping?
>> 4. Should I just stick with Jackson for Jersey 2.x or will I get some
>> special goodness from MOXy that I wont with Jackson?
>>
>>