Tuesday Jan 13, 2015

Reactive Jersey Client

One of the common problems of synchronous applications is that they are not using resources in an efficient manner. In a synchronous application, it often happens, for example, that threads are blocked waiting for something to happen.  That is clearly not efficient!  On the other hand, asynchronous applications allows to better utilize those threads but this often comes at a price as it is not that easy to write (complex) asynchronous applications.  Writing asynchronous applications involve having to deal with nested callbacks, the famous "callback hell".  And if the level of nested callbacks is too deep, it can also be very tricky to properly handle errors within the application, etc.

Reactive programming is a popular paradigm used to develop more easily asynchronous applications; it is based around data flows and changes propagations.  This Reactive approach also leads to be more maintainable too as the code is easier to write and understand.

Michal Gajdos of the Jersey Team has just written a series of posts introducing the 'Reactive Jersey Client API', a new generic API allowing end users to utilize the popular reactive programming model when using Jersey Client. 

Tuesday Oct 14, 2014

JSR 339 Maintenance Release: JAX-RS 2.0 rev A

JAX-RS 2.0 (JSR 339) has been slightly revised through the JCP Maintenance Release process and has recently passed the JCP MR ballot

This update (JAX-RS 2.0 rev A) is mostly about clarifications (including JavaDoc clarifications) and some fixes in Jersey, the JAX-RS Reference Implementation. The updated documents will be published soon on the JSR 339 page but in the meantime, you can check this page for details about the changes of JAX-RS 2.0 rev A.

It should be noted that GlassFish 4.1, the Java EE 7 Reference Implementation, already supports this version of the JAX-RS specification (i.e. JAX-RS 2.0 rev A).

Friday Sep 12, 2014

JSR 370: Java API for RESTful Web Services 2.1

A proposal for JAX-RS 2.1 has been recently submitted to the JCP, this news was a bit overshadowed by the Java EE 8 Platform submission announcement but it is also important. It is important as JAX-RS is a significant technology of the the Java EE Platform but JAX-RS is also very relevant outside of the platform. It is not uncommon to see more specific RESTful based applications built upon a standalone JAX-RS implementation. And with the Client API introduced in JAX-RS 2.0, JAX-RS is also getting more and more relevant in the client space.

JAX-RS 2.1 (JSR 370) has now entered the JSR Review Ballot for a 2 weeks period (ends on September 22). The proposed scope of JAX-RS 2.1 currently includes :

  • Adding support for Server-Sent Events
  • Improving integration with CDI
  • Exploring support for non-blocking I/O in providers (filters, interceptors, etc.)
  • Evaluating ways in which declarative security can be supported
  • Providing integration with JSON-B
  • Making JAXB conditional on runtimes where it is available
  • Building upon the hypermedia API introduced in version 2.0
  • Investigating the reactive programming paradigm as a way to improve the JAX-RS asynchronous client API
  • Evaluating any requirements necessary to support the use of JAX-RS resource classes as controllers in the MVC 1.0 JSR

Even tough JAX-RS 2.1 will be a 'minor' release; its current scope is quite large in terms of added features!

And if you are attending JavaOne, here are a few JAX-RS related sessions that you should consider attending :

Monday Dec 16, 2013

Java EE@Pune JUG

Pune JUG organized a meetup at the Symbiosis Institute of Computer Studies and Research (SICRSR) college campus on December 14th. Led by Harshad Oak (Java Champion and organizer of the IndicThreads conference), Pune JUG is the oldest JUG in India and boasts a vibrant developer community. This month's meetup was focused on the Java EE 7 platform and the ecosystem that is building up around it. The meeting was led by Oracle India's own Vijay Nair. Vijay is a good friend and a lead developer with Oracle's FLEXCUBE development group in India. Among many other things like evangelizing Java EE at local Java user groups and conferences, Vijay contributes heavily to the Cargo Tracker Java EE Blue Prints project in his spare time.

 The event saw an attendance of close to around 100 people with a lot of demos/code and high quality interactions with the audience. Vijay presented no less than three sessions at the meetup:

  • JavaEE.Next(): Java EE 7, 8, and Beyond - This is basically our flagship talk at the moment. The talk briefly covers the evolution of the platform, details the changes in Java EE 7 and invites developers to help shape Java EE 8. The materials for the talk is posted here.
  • Android and iOS Development with Java EE 7 - This was a fairly popular technical session at JavaOne San Francisco 2013 led by me, Ryan Cuprak and Bala Muthuvarathan. The session demonstrates how Java EE 7 acts as an excellent platform for building "headless" back-ends for native mobile applications with REST and WebSocket as the client communication protocols. The materials for the talk is posted here. The code is posted on GitHub.
  • Using NoSQL with JPA, EclipseLink and Java EE - This session explores the current state of the NoSQL landscape and how Java EE can be utilized to access NoSQL solutions such as Oracle NoSQL, MongoDB, Cassandra, etc utilizing JPA style facades or plain CDI. The materials for the talk is posted here. The code is posted on GitHub.

Overall, this was a very positive experience with developers giving two thumbs way up to the Java EE 7 platform!

Friday Jun 21, 2013

JAX-RS 2.0, JTA 1.1, JMS 2.0 Replay: Java EE 7 Launch Webinar Technical Breakouts on YouTube


As stated previously (here) (here), the On-Demand Replay of Java EE 7 Launch Webinar is already available. You can watch the entire Strategy and Technical Keynote there, and all other Technical Breakout sessions as well.

We are releasing the next set of Technical Breakout sessions on GlassFishVideos YouTube channel as well. In this series, we are releasing JAX-RS 2.0, JTA 1.1, and JMS 2.0.

Here's the JAX-RS 2.0 session:



Here's the JTA 1.1 session:



Here's the JMS 2.0 session:



Enjoy watching them over the next few days before we release the next set of videos!

And don't forget to download Java EE 7 SDK and try numerous bundled samples.

Friday Jul 06, 2012

Jersey 2 Integrated in GlassFish 4

JAX-RS 2.0 has released Early Draft 3 and Jersey 2 (the implementation of JAX-RS 2.0) released Milestone 5.

Jakub reported that this milestone is now integrated in GlassFish 4 builds. The first integration has basic functionality working and leaves EJB, CDI, and Validation for the coming months.

Jersey 2.0 in GlassFish 4

TOTD #182 explains how to get started with creating a simple Maven-based application, deploying on GlassFish 4, and using the newly introduced Client API to test the REST endpoint.

GlassFish 4 contains Jersey 2 as the JAX-RS implementation. If you want to use Jersey 1.1 functionality, then Martin's blog provide more details on that. All JAX-RS 1.x functionality will be supported using standard APIs anyway. This workaround is only required if Jersey 1.x functionality needs to be accessed.

Here are some pointers to follow

Provide feedback on Jersey 2 to users@jersey.java.net and JAX-RS specification to users@jax-rs-spec.java.net.

Friday Jun 08, 2012

JAX-RS 2.0 Early Draft - Third Edition Available

JAX-RS 2.0 Early Draft Third Edition is now available. This updated draft include new samples explaining the features and clarifications in content-negotiation, discovery of providers, client-side API, filters and entity interceptors and several other sections.

ALT_DESCR

Provide feedback to users@jax-rs-spec.

Jersey 2.0, the Reference Implementation of JAX-RS 2.0, released their fourth milestone a few days ago as well. Several features have already been implemented there. Note, this is an early development preview and several parts of the API and implementation are still evolving.

Feel like trying it out? Simply go to Maven Central (of course none of this is production quality at this point). The latest JAX-RS Javadocs and Jersey 2.0 API docs are good starting points to explore. And provide them feedback at users@jersey.java.net or @gf_jersey.

Thursday Apr 12, 2012

EclipseLink Moxy Provider for JAX-RS and JAX-WS

EclipseLink MOXy is a JAXB provider bundled in GlassFish 3.1.2. In addition to JAXB RI, it provides XPath Based Mapping, better support for JPA entities, native JSON binding and many other features.

Learn more about MOXy and JAXB examples on their wiki.

ALT_DESCR

Blaise blogged about how MOXy can be leveraged to create a JAX-WS service.You just need to provide data-binding attribute in sun-jaxws.xml and then all the XPath-based mapping can be specified on JAXB beans.

MOXy can also be used as JAX-RS JSON provider on server-side and client-side.

How are you using MOXy in your applications ?

Wednesday Mar 28, 2012

Jersey 2.0 Milestone 2 Now Available

Jersey 2.0 milestone 2 is now available. It builds upon the first milestone and adds several new features such as server-side asynchronous processing, server-side content negotiation, improved JAX-RS parameter injection, and several others.

ALT_DESCR

The REST endpoints can be published on Java SE HTTP Server, Grizzly 2 HTTP container, and some basic Servlet-based deployments. It also provides HTTPURLConnection-based client API implementation. Read about these and more about what's new in Marek's detailed post. Of course this is also the future reference implementation for JAX-RS 2.0.

Feel like trying it out? Simply go to Maven Central (of course none of this is production quality at this point). The latest JAX-RS Javadocs and Jersey 2.0 API docs are good starting points to explore. And provide them feedback at users@jersey.java.net.

Thursday Feb 09, 2012

A status on JAX-RS 2.0. Early Draft.

With the Early Draft of JAX-RS 2.0 review period closed for a little while now, here's Arun's walk through the technology's new and improved features.

ALT_DESCR

The Client API seems to be a very popular feature and one that seems pretty stable at this point. Filters and Handlers is another set of new features enabling interception of requests and responses while Hypermedia, a founding principle for REST, is better supported. JAX-RS 2.0 also offers the ability to validation parameters with BeanValidation, introduces asynchronous processing (returning Future objects on the client side) and finally better connection negotiation. Read all about it here.

JAX-RS has become an important component of the Java EE platform and the cloud theme going forward is only making it even more relevant. Check out this earlier post for Marek's (co Spec Lead on JAX-RS 2.0) take on where the JSR stands.

Friday Jan 06, 2012

Tab Sweep - JSON, OSGi, GlassFish+NetBeans experience, JAXB and JodaTime, file uploads & more

Recent Tips and News on Java, Java EE 6, GlassFish & more :

Radio Receiver

JSON to Java with JDK6 (Julien)
What does the future hold for OSGi without leader Peter Kriens? (JAXenter)
JavaCloudGuy: Glassfish (Java EE 6) is now available as option in #cumulogic (Twitter)
JAXB and Joda-Time: Dates and Times (Blaise)
JAX-RS Tip of the Day: Using YUI2 and YUI3 DataTables with Jersey and jQuery (John)
JAX-RS @MatrixParam example (mkyong)
First experiences and getting started with GlassFish 3.1 and NetBeans 7.x – it’s a breeze (Lucas)
Maven's WAR Overlay: What are WAR Overlays? (DZone)
Book Review for "Java EE 6 with GlassFish Application Server" (Rick)
Managing unmanaged beans in CDI (Nicolas)
Using Bean Validation together with ExtVal in JPA and JSF (Edwin)
Java EE 6 using WebLogic 12c and NetBeans (Video) (Arun)
Spark, A micro Web Framework (spark.com)
Multiple File Upload Examples (John Yeary)
Released: NetBeans Platform 7, The Book (Geertjan)
Java 7: Understanding the Phaser (Niklas)
Where's my log file? (Nigel @ Open Messaging)
Sample: Java EE 6 + Wicket + NetBeans + GlassFish + MySQL (Geertjan)
Using Jsp in a Jersey JAX-RS RESTful application (François)
How to change the Glassfish server log level from command line (François)

Monday Nov 21, 2011

Marek's JAX-RS 2.0 content from Devoxx 2011

Marek Potociar, one of the two co-spec leads for the upcoming JAX-RS 2.0 had a very well-attended session at Devoxx and wrote a blog post about it detailing his conference experience (1st time at Devoxx) and running through the new features of the specification.

A link to slides is also included in his post.

ALT_DESCR

The work by the expert group seems very solid at this point as you can read for yourself in details in the recently published early draft document.

You can follow the remaining work between now and the middle of new year on the specification project pages on java.net.

Sunday Oct 16, 2011

JAX-RS 2.0 Progress and Client API

One of the very well attended set of sessions and highly anticipated Java EE 7 technology is JAX-RS 2.0 (JSR 339), a specification that now has an early draft awaiting publication.

Co-spec lead Santiago Pericas-Geertsen has started a series of blogs on important features, starting with the Client API.

ALT_DESCR

As expected, this defines a Client class and a builder pattern for better readability. Make sure you read Santiago's piece to understand what Message Body Writers (or MBWs) are and how configurable this API is meant to be.