How To Use Jersey Client Efficiently

While fixing a memory leak issue in JerseyClient some time ago i realised how easy it is to misuse the thing. In this blog post, i would like to introduce some tips to avoid unnecessary memory allocation and also to save some CPU cycles to achieve better throughput. Tip 1: Be careful when updating WebTarget config! In Jersey 1.x it was suggested to reuse Client instances (see here for details).In Jersey 2, reusing Client instances is still recommended, but as such it is not...

Monday, March 30, 2015 | REST | Read More

Jersey 2.x Client on Android - Take 2

In my earlier post i described what we did in Jersey version 2.16 in order to make Jersey client work on Android. The whole idea was that after separating JAXB providers out from the Jersey core module, things would just work out of the box. Unfortunately, it turned out the JAXB provider separation was not enough. Basic things worked (see my original post for a test case application), but Jersey was still trying to pull in some types not available in Android environment....

Tuesday, March 17, 2015 | REST | Read More

Jersey 2.17 Has Been Released

We have just released the 2.17 version of Jersey, the open source, production quality, reference implementation of JAX-RS 2.0. To download Jersey 2.17, please check out our download page. You can also check out the refreshed Jersey 2.17 documentation: API: https://jersey.java.net/apidocs/2.17/jersey/ User Guide: https://jersey.java.net/documentation/2.17/ This version includes mainly bug fixes. Following is a list of the most important updates: Ability to use multiple Jersey based...

Monday, March 16, 2015 | REST | Read More

When to Use JAX-RS Class-path Scanning Mechanism

The short answer is: never!. I have seen several nasty (so called) "bugs" caused by this feature so that i felt like sharing this little advice via blog post: Never ever use JAX-RS class-path scanning feature in a production environment Class-path scanning looks like a handy feature. Let say you do not want bother with enumerating all the components you would like to include in your JAX-RS application. Then your JAX-RS application class could look like: import...

Tuesday, March 3, 2015 | REST | Read More

Container Agnostic CDI Support In Jersey

Introduction At the time of this writing, Java SE support is being discussed as one of important additions to CDI 2.0 specification. Existing CDI implementations brought this feature already, only container bootstrapping has not yet been standardized. In Jersey version 2.15 we introduced Weld SE support, so that people could take advantage of CDI features also when running in Java SE environment. As part of this work, the old Jersey CDI module has been refactoredso that it...

Friday, February 13, 2015 | REST | Read More

Jersey 2 Performance

During my sabbatical week in January i have done some performance improvements in Jersey server core module. These changes are already included in Jersey version 2.16. To make sure the changes indeed made a positive difference i have re-established continuous performance testing for Jersey server side processing. These automated tests allowed Michal Gajdoš to collect some numbers that show how performance evolved within Jersey 2.x version space.In this post i would like to...

Thursday, February 12, 2015 | REST | Read More

Integrated Cloud Applications & Platform Services