I didn’t really plan for it, but with a conference free month, I had the chance to dig around a little more and show you even more of the Camel on WildFly magic, that the WildFly-Camel subsystem provides. The Business Background The demo is derived from one on JBoss Demo-Central by Christina Lin. She demonstrates the use of File and JDBC ...
Read More »Injecting Kubernetes Services in CDI managed beans using Fabric8
Prologue The thing I love the most in Kubernetes is the way services are discovered. Why? Mostly because the user code doesn’t have to deal with registering, looking up services and also because there are no networking surprises (if you’ve ever tried a registry based approach, you’ll know what I am talking about). This post is going to cover how ...
Read More »CDI & EJB: Sending asynchronous mail on transaction success
Hello again! :) This time I’ve chosen a common task that most of the time, in my opinion, is done the wrong way: sending e-mails. Not that people can’t figure out how e-mail APIs work, such as JavaMail or Apache’s commons-email. What I usually see as a problem is that they underestimate the need to make the sending mail routine ...
Read More »Simplifying JAX-RS caching with CDI
This post explains (via a simple example) how you can use CDI Producers to make it a little easier to leverage cache control semantics in your RESTful services The Cache-Control header was added in HTTP 1.1 as a much needed improvement over the Expires header available in HTTP 1.0. RESTful web services can make use of this header in order ...
Read More »Playing with Weld-Probe – See All of your CDI Aspects in One Place
Weld 3.0.0.Alpha4 was released, while I’ve been sitting in a conference room at DevConf.CZ. More or less next to Jozef Hartinger ( @jozefhartinger) who told me about the new awesome features of this latest release a few minutes before in a shared break. There is one particular feature, that really caught my attention which is the new Weld Probe mechanism. What ...
Read More »Integrating CDI and WebSockets
Thought of experimenting with a simple Java EE 7 prototype application involving JAX-RS (REST), WebSockets and CDI. Note: Don’t want this to be a spoiler – but this post mainly talks about an issue which I faced while trying to use web sockets and REST using CDI as a ‘glue’ (in a Java EE app). The integration did not materialize, ...
Read More »Java EE Interceptors
History I think it’s important to take a look at the evolution of Interceptors in Java EE because of the simple fact that it started as an EJB-specific item and later evolved into a separate spec which is now open for extension by other Java EE specifications. Version 1.0 Interceptors were first introduced in EJB 3.0 (part of Java EE ...
Read More »Updates on CDI 2.0
CDI 2.0 is the next version of Contexts and Dependency Injection for the Java EE Platform and a candidate for inclusion in Java EE 8. It is being worked upon since September 2014 and moving pretty rapidly ! Major goals for CDI 2.0 Alignment with Java SE 8 (of course!) Support for ...
Read More »Simple Aspect Oriented Programming (AOP) using CDI in JavaEE
We write service APIs which cater to certain business logic. There are few cross-cutting concerns that cover all service APIs like Security, Logging, Auditing, Measuring Latencies and so on. This is a repetitive non-business code which can be reused among other methods. One way to reuse is to move these repetitive code into its own methods and invoke them in ...
Read More »