Posts

Showing posts from October, 2022

JavaEE CDI - Contexts and Dependency Injection

CDI (Contexts and Dependency Injection) is a standard dependency injection framework included in Java EE 6 onwards. CDI is also part of the Eclipse MicroProfile project, a framework use for development of Microservice application. ### CDI Releases | CDI Version | Release Year| |:-----------:|:-----------:| | CDI 1.0 | 2009 | | CDI 1.1 | 2013 | | CDI 1.2 | 2014 | | CDI 2.0 | 2017 | | CDI 3.0 | 2020 | | CDI 4.0 | 2022 | ### New Features - Removal of deprecated code Ex - **@New** qualifier which was deprecated in version 1.1 - Change in Bean discovery Mode CDI 4.0 bean discovery mode is by default Annotated - Support for Java Module system ( introduced in Java v9) - Introducing CDI Lite #### The “beans.xml” File First, we must place a **beans.xml** file in the - **src/main/resources/META-INF/** folder with **bean-discovery-mode** set to ```all``` or ``annotated`` Even if this file doesn't contain any sp...

Microservices using Eclipse Microprofile

Image
## What is MicroProfile ? MicroProfile is enterprose Java for Microservices development. It is an Open source framework. Initial version released in year 2016 with: - CDI - JAX-RS - JSON-P Over the years MicroProfile is evolving to solve the challenges in Microservice development. Given below are few features added to MicroProfile in recent release. - Configuration - Fault Tolerance - JWT Propogation - Health Check - Metrics - Open Tracing - Open API - Rest Client ## Why we need MicroProfile? MicroProfile evolved due to slowdown in JavaEE innovation. JavaEE was not prepared for Microservices development. ## MicroProfile Implementation - RedHat WildFly (https://www.wildfly.org/) - IBM WebSphere Liberty (https://www.ibm.com/products/websphere-liberty) - Open Liberty ( https://openliberty.io) - TomEE (https://tomee.apache.org/) - Payara Micro (https://www.payara.fish/) - ThornTail - Quarkus ( https://quarkus.io/) ### CDI - Contexts and Dependency Injection - Bean...