Switching JAX-RS serializer in payara

When working with Payara I stumble every once in a while over JSON-serialization issues. Payara v4 uses MOXy as default provider while Payara v5 comes with JsonB-support which apparently makes use of Yasson. Although, after moving from v4 to v5 I’m fine with the JsonB-default it may still be useful to use Jackson as JSON provider instead of the default one (to be honest, many things just worked out-of-the-box with Jackson like reflective access to props (no extra getter necessary) or support for Maps etc....

January 16, 2020 · 1 min · schoeffm

Response streaming between JAX-RS and Web-Components (Part 1)

When dealing with JAX-RS resources are normally assembled completely in memory before being put onto the wire for transmission. If the resulting response fits into one single chunk the transmission is accomplished in one go - if the content is bigger than 16kB it will be split into several chunks of that size. You can see the difference in the response headers where a one-go-transmission contains the Content-Length-header (where the server announces the size of the content to be transmitted) while a chunked transmission lacks the Content-Length header but contains a Transfer-Encoding: chunked header. ...

July 27, 2019 · 3 min · schoeffm

API versioning using vender specific media types in JAX-RS

Content Negotiation in JAX-RS allows you to leverage the information in the client requests Accept header to map that request to a specific handler-method within your application. In combination with vendor-specific media types this approach can be used for versioning of an API. ...

June 10, 2019 · 2 min · schoeffm