Adam Bien's Weblog

Oracle Commits To Java EE, WildFly Swarm, Payara Micro, Docker and Microservices, Smells Like CDI or the 28th airhacks.tv Questions and Answers

This time 110 live attendees participated in the 28th edition of airhacks.tv with topics from dynamic DI, over Oracle Java EE announcements, logging strategies over Payara and WildFly microservices, to introducing a new shiny hardware:

Any questions left? Ask now and see your topic discussed at the first Monday of the month, 6 pm CET.

See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

July 2016: Java is #1 And Raising

The Java programming language becomes even more popular (19.804%) and gains 2.08%. Second is the C programming language (12.238%) which lost 3.91% -- the gap is larger. C was number #1 in 2001.

Java is also doing well comparing the "Monthly Commits" of JavaScript, C, Clojure, Scala and Go.

One of the recurring airhacks.tv questions is: "As I student, should I still invest in Java?" :-)

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

xplr: Utility For Migrations To Maven

Java projects without dependency management directly rely on JARs contained in the project structure for compilation and deployment purposes.

A migration to maven requires the analysis of the JARs origin. All JARs needs to be replaced by dependencies defined in Maven's pom.xml. Sometimes the used JARs already contain maven information, in some cases the meta information is stored in the JAR's manifest.mf.

xplr is a self-contained, 15 kB, Java 8 CLI utility, which recursively traverses folders, searches for JARs and extracts any pom or manifest information. xplr also generates the mvn install:install-file statements which help you to install any proprietary libraries to the maven repository.

Applied to itself with java -jar target/xplr.jar . xplr produces the following output:


(...)
#####################################
Directory: ./target
#####################################

# Jar: ./target/xplr.jar
## Manifest: 
## Package: com.airhacks.xplr
Archiver-Version:Plexus Archiver
Built-By:abien
Created-By:Apache Maven 3.3.3
Build-Jdk:1.8.0_77
Manifest-Version:1.0
Main-Class:xplr.Explorer

## POM: 
<dependency>
 <groupId>com.airhacks</groupId>
 <artifactId>xplr</artifactId>
 <version>0.0.1</version>
 <packaging>jar</packaging>
</dependency>
## MVN install command: 
mvn install:install-file -Dfile=./target/xplr.jar 
-DgroupId=com.airhacks -DartifactId=xplr -Dversion=0.0.1 -Dpackaging=jar
---
(...)

With two parameters: java -jar xplr.jar [FOLDER] [CLASS NAME] xplr lists all JARs containing the specified class name (excerpts are supported). E.g.

java -jar target/xplr.jar . Injector will find:

#####################################
Directory: ./src/test/jars
#####################################

# Jar: ./src/test/jars/afterburner.fx-1.6.2.jar
## Manifest: 
## Package: com.airhacks.afterburner.configuration
Archiver-Version:Plexus Archiver
Built-By:abien
Created-By:Apache Maven 3.2.1
Build-Jdk:1.8.0_31
Manifest-Version:1.0

## POM: 
<dependency>
 <groupId>com.airhacks</groupId>
 <artifactId>afterburner.fx</artifactId>
 <version>1.6.2</version>
 <packaging>jar</packaging>
</dependency>
## MVN install command: 
mvn install:install-file -Dfile=./src/test/jars/afterburner.fx-1.6.2.jar 
-DgroupId=com.airhacks -DartifactId=afterburner.fx -Dversion=1.6.2 -Dpackaging=jar
---


xplr is apache licensed GitHub project: https://github.com/AdamBien/xplr. First release is available for download (15 kB).

Happy migrations! See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

CDI smells, Oracle and Java EE 8, JAX-RS, Logging, Microservices, Monitoring or 28th airhacks.tv Questions and Answers

Questions for the 28th airhacks.tv, Today (July, 13th) at 6 pm CET:

  1. Java EE 8 News
  2. New server (the real hardware): the part list.
  3. Oracle says it is 'commmitted' to Java EE 8
  4. microprofile.io announcement
  5. Wildfly-Swarm, Payara Micro and the relation to microservices
  6. Dynamic injection into @Stateless EJBs
  7. Handling ViewExpiredException in JSF
  8. Managing JAX-RS clients on servers
  9. Accessing GlassFish / Payara logifles from the browser
  10. Is overusing CDI a code smell?
  11. JAX-RS MessageBodyWriter and Singleton challenges
  12. How to approach logging in microservices?
  13. Monitoring Java EE methods

Ask questions during the show via twitter mentioning me: http://twitter.com/AdamBien (@AdamBien) or using the hashtag: #airhacks. You can join the Q&A session live each first Monday of month, 6 P.M at airhacks.tv or http://www.ustream.tv/channel/adambien

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Validating JsonObjects In JAX-RS With Bean Validation And Java EE 7

Java EE 7 introduced parameter validation for managed beans (CDI / EJB). This feature can be used to implement a ConstraintValidator for JsonObject parameters of JAX-RS resources:

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Comes Java EE With The Smallest Docker Images?

Are Java EE application servers too fat for microservices? You will find the answer in the following 6 min screencast:

I used for the evaluation the docker images from docklands and the project ping as sample application. See also: The Memory Usage of Java EE 7 Application Servers Running On Docker and The Overhead Of Java EE Application Servers and On Stage Microservices Hacking at InfoShare

See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices. Is MUC too far? Watch online: javaeemicro.services.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

The Enterprise Java Future Is Bright: Java EE 8 MicroProfile Launched

During the DevNation conference at 27.06.2016 in San Francisco, Red Hat, IBM, Payara, Tomitribe, LJC (additional surprises are possible :-)) announced the availability of the Java EE 8 MicroProfile (at 36m, after the announcement of commercial support of Java EE 7 for JBoss):

See also related blog posts: RedHat, IBM, Payara, TomEE.

What's inside? Right now it is an essential set of JSRs: CDI, JAX-RS and JSON-P (inclusion of Bean Validation 2.0 is also considered). Anything else is going to be decided by the community (join the discussion). The Microprofile Dockerfiles of the supporting vendors are expected to arrive soon.

The Java EE 8 microprofile.io focusses on productivity and "cloud-native" / microservices readiness in high-density scenarios. Before you start solving problems you don't have, consider that "fully loaded" application servers are already surprisingly small, particularly on docker.

See you at Java EE Workshops at Munich Airport, Terminal 2 and particularly at Java EE 7 Microservices, or online: javaeemicro.services


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

A Code-Driven Microservices Session. From infoSharePL 2016

During the (great) infoShare 2016 conference (reminds me at the early JavaOne's), I delivered a short session as an intro to the microservice workshop afterwards:

The workshop was not recorded and comprised a constant stream of questions. However, if you are interested, attend a workshop at Munich's Airport Java EE Microservices, or online: javaeemicro.services.


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

From Electronic Transactions Over Banking Services To Payment Gateways--Java EE 7 In FinTech

Jakub, please introduce yourself

Hi. I've been a Java developer for almost 10 years now, working mostly with Java EE. Here at Blue Media I'm a Software Architect who tries to stay in touch with the code.

What are you building with Java EE?

We're a company which invents and delivers our own services in so called FinTech. Blue Media is a provider of solutions for electronic transactions and online support--from the automation of home payments to complex, custom-designed electronic banking services. We're building payment gateways and software that helps people move funds from one bank to another. Everything is developed as a service that is integrated with our clients systems

How big is your team?

The team I manage comprises of 11 talented developers who are divided into 4 working groups which are handling modules of our systems. This structure allows as to cope and hand-deliver tasks with great efficiency.

Can you share with us some geeky numbers like e.g. TX per seconds, heap sizes etc -- whatever Java EE devs might find interesting.

Our biggest database hits 150 TX/s running on 64GB of RAM and 16CPUs, we're running our production systems on around 400 virtual hosts

150 tx/s does not sounds a lot. What comprises a typical transaction in your system (DB access, verification, remote communication etc.)?

A single transaction comprises of a few "jumps" between various modules (microservices) each of which usually has it's own database, so the workload is somehow distributed. For example a payment transaction is:

  1. validate (read conf from db)
  2. insert into db
  3. 5-6 updates in db later on (changing payment status, filling up payer data)
  4. external communication through JMS (internal calls) or HTTPS
  5. execute settlement (update again)
This is also distributed in time (5-10min) Highest value for TPS in our payment database I've got from Zabbix is 250

For comparison our highest throughput system running SMS Gateway (sending authorization messages for banks) has this metric at around 200, with peeks hitting 1000

Are you happy with Java EE so far?

Yes, it's a great environment to work with, provides lots of features out of the box and really simplifies development in a transaction dependent software. Otherwise I don't think I'd have stick to it for so long. I'd really encourage everyone to give it a try and see for themselves how easy it is to do things with it

Which application servers, tools or IDEs are you using?

We're running our systems on JBoss/Widlfy with Postgres as our database and ActiveMQ for JMS. We're trying to stay up-to-date with our app servers as much as we can, but to be honest we're still running few instances of old Jboss 4.2.0. On daily basis we work with Maven, GIT, Bamboo as CI and continuous delivery, Intellij IDEA is out IDE of choice, Crucible for peer code review and pgAdmin. Other tools for task management are Jira, Confluence. We're now trying to move to Docker and experiment with ELK stack which hopefully will help us handle our enviroment even better

How important are standards for you? Does your application depend on application server specific APIs?

We try to stick to standards as long as we can so we usually don’t use anything that is not specified by the core Java EE. This helps us to move to newer versions of the spec and app servers faster. Our systems were first developed using old J2EE, and we've had some trouble moving to later version but since JEE 6 it have been definitely easier. Sometimes though it is necessary to write some server specific code like for example when clustering singletons.

Which Java EE APIs are you using in your products?

JPA, JMS, JAX-RS, Bean Validation, JTA, EJB, CDI

Take a look at the Java EE 8 APIs. Which of the APIs are most interesting / important to you?

From the new features I'd go with JSR 107
As for existing things JMS 2.1, JAX-RS 2.1 and CDI 2.0 since we heavily use them in everyday development

Can you share any resources (blogs, etc feel free to promote yourself) with us?

On of my favorite places lately is HackerNews where you can find useful and interesting stuff happening in and our development world. Comments sections is really great here as well. I also like to read DaedTech which is more of a developer-philosophy blog than a technical one.

Is Blue Media hiring Java EE developers?

Yes ! If you are Java JEE developer or someone who is passionate about new technologies come and join Blue Media! We come from all places and backgrounds but we all share a passion for the future

Jakub, thank you for the interview!


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

Singleton Pattern in ES6 and ES7


export default class Singleton {

  static instance;

  constructor(){
    if(instance){
      return instance;
    }

    this.state = "duke";
    this.instance = this;
  }

}

Now:


let first = new Singleton();
let second = new Singleton();
console.log(first===second);

//output: true

The code above uses ECMAScript 2015/ES6 (classes) and ECMAScript 2016/ES7 (static fields) features. It transcompiled, "old school" ES5 representation looks like:


	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	var Singleton = function Singleton() {
	  _classCallCheck(this, Singleton);

	  if (instance) {
	    return instance;
	  }

	  this.state = "duke";
	  this.instance = this;
	};

	exports.default = Singleton;

See you at JavaScript Bootstrap or Building Apps with React!


NEW workshop: Building HTML 5 Applications With Angular 2
Full week in December 2016: from Java EE 7 Bootstrap, Effective, Architectures over Testing to Microservices
On demand workshops: Java EE 7: Bootstrap, Effective, Testing and Microservices available for streaming.

Newsletter: airhacksnews.com

A book about rethinking Java EE Patterns

realworldpatterns.com
Online Workshops
...the last 150 posts
...the last 10 comments
License