Towards Flexible Metrics Using SimplyTimed

When revision 2.3 of the microprofile metrics API was release earlier this year it introduced a new metric type called Simple Timer. Granted, with a name like that it’s easy to underestimate this new type - but don’t get tricked by its unspectacular title. Turns out, most of the time (especially in my projects where we also make use of Prometheus) it’s a way better suited and more flexible metric than i.e. its older cousin Timer. ...

March 29, 2020 · 5 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