Category Archives: Java

Glassfish 5: JAX-RS SSE quickstart

Latest Glassfish 5 build 08 was announced today which includes JAX-RS 2.1 (JSR 370) integration. I am fond of Server Sent Events (SSE), so let’s take it for a test ride – here is a Docker based quick start on Github … Continue reading

Posted in Java, Java EE | Tagged , , , , , | 2 Comments

Validate JAX-RS query parameters

  It’s easy to validate parameters in JAX-RS using filters – ContainerRequestFilter to be specific. There are other options at your disposal e.g. using (CDI or EJB) interceptors, or injecting (HttpServletRequest using @Context) Scenario – Validate query parameter passed in by the … Continue reading

Posted in Java, Java EE | Tagged , | Leave a comment

Accessing HTTP Session in WebSocket endpoint

It’s possible to obtain a reference to the HttpSession within a WebSocket application using a custom implementation of ServerEndpointConfig.Configurator Here is an example application on Github Steps… Override the modifyHandshakeRequest method call the getHttpSession method on the HandshakeRequest object which is passed into the … Continue reading

Posted in Java EE | Tagged , , , , | Leave a comment

kafEEne #2: Kafka & Concurrency Utilities

Yet another blog post of the kafEEne series – this time, its Java EE Concurrency Utilities in action along with Kafka. As usual, the code is on Github and you can refer to the README on how to get this up … Continue reading

Posted in Java EE | Tagged , , , , , , | Leave a comment

Consume from Kafka topics using Message Driven Beans

Thanks to the recently released Payara Kafka Connector, you can now consume messages from Kafka using Message Driven Beans! Here is a Docker based example for trying it out. Quick overview A @Singleton bean fires a producer process which run in … Continue reading

Posted in Java EE | Tagged , , , , , , | 2 Comments

kafEEne #1: Websocket & Kafka

Say hello  to kafEEne ! A blog series which will show Kafka and Java EE examples This one is about Kafka + (Java EE) Websocket API. Code is on Github and you can refer to the README on how to get this … Continue reading

Posted in Java EE | Tagged , , , , , , , | 1 Comment

Redis CDI example….

Here is an example of a CDI producer for Redis using the Jedis (Java) client for Redis. Check out the project README to get this up and running…. Below is a quick summary Use of CDI Qualifier Two types of … Continue reading

Posted in Java EE, NoSQL | Tagged , , , | Leave a comment

Handling ‘state’ in Java WebSocket applications

By and large, there are two kinds of states in a WebSocket application User/client specific: related to a connected user/Session e.g. user ID, list of subscriptions, last message received etc. Global: state which is relevant across your application and something … Continue reading

Posted in Java, Java EE | Tagged , , | 2 Comments

Using CDI with Java EE Concurrency Utilities

This blog post explores usage of CDI along with Java EE Concurrency Utilities – specifically using CDI beans as managed tasks. Here is the sample application on Github Lets begin with a quick overview Java EE Concurrency Utilities provides APIs … Continue reading

Posted in Java, Java EE | Tagged , , , , , , | 5 Comments

Trending Meetup groups with Redis and Java EE

This is an application which displays the currently trending Meetup groups based on their (live) RSVPs feed. It’s built using Java EE 7 (uses WebSocket client & server APIs, Singleton EJB timers and CDI events to wire things up) and … Continue reading

Posted in Java, Java EE | Tagged , , , , , , , | Leave a comment