Dead javax, Singleton performance, exactly once, DB authentication, refresh tokens, Kafka, distributed failures--62nd airhacks.tv

62nd airhacks.tv episode with the following topics:

"javax and Jakarta EE's future, singleton performance, exactly once delivery, DB authentication and refresh tokens, Kafka Java EE integration, distributed failures with microprofile, openjdk, oauth and refresh tokens, JSF and memory, green field architectures, javafx, embedded space, and interactive code review":
Any questions left? Ask now: and get the answers at the next airhacks.tv. See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Using ConfigMaps To Configure MicroProfile Applications

Injecting values from ConfigMap into a MicroProfile (Configuration) / Java EE application. The project was created with Java EE 8 / MicroProfile essentials archetype and deployed with payara-s2i image to OpenShift:

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


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

javax and future of Jakarta EE, TX, quarkus, startup, Java FX, MicroProfile, openJDK support, Green Field Architectures--or 62nd airhacks.tv

Topics for the 62nd airhacks.tv: https://gist.github.com/AdamBien/001c1bad3f868a8508783569e192ea3d:

  1. Cloudy airhacks
  2. Jakarta EE and the javax issue (see post) and the future of Jakarta EE
  3. It it worth to use @Singleton
  4. Server-specific injection and server detection
  5. Exactly once delivery with Java EE without XA
  6. Fetching a principal from a database
  7. persistence.xml location
  8. Jakarta EE with Kafka
  9. Dealing with distributed system failures with or without MicroProfile
  10. openjdk compatibility concerns
  11. oauth implementation and refresh tokens
  12. green field architectures discussions (openshift, kubernetes, docker etc.)
  13. understanding existing code bases
  14. handing viewscoped in JSF
  15. Java FX and embedded space
  16. @Counted and @Named MicroProfile bug
  17. Thoughts on quarkus and specifications

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 Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Java Native Database--Airhacks.fm Podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

An airhacks.fm conversation with Markus Kett (@MarkusKett) about:

C64 and sports games, Weiden is not in Bavarian Forest, soccer as motivation for programming, writing first programs in basic with 17, writing contacts management, PCs are boring machines, but good for business, Java is the best programming language, Pentium 1 was introduced at CEBIT in 1993, the dream about an own booth at CEBIT came true, webdesign software based on applets (XPage) was very successful at SYSTEMS in Munich, Markus was the business man and had no time for programming - like Steve Jobs, self-financing with selling products, competing with Microsoft and Adobe, writing a 4GL Java-based development environment like Visual Basic called XDev, Java Developers don't like the Drag and Drop programming experience, building an IDE from scratch, discussions with Sun Microsystems about StarOffice integration, migrating from Swing to SWT and Eclipse, using Vaadin as UI technology, connecting beautiful UI to DB was too hard, databases have more types than Java what makes code generation hard, in 4GL the database comes first, RapidEclipse is free but commercial support is available, XDev provides tool and project support, RapidClipse understands rich database types and generates JPA POJOs, Hibernate importer, how to write queries in Java, implementing JPA-SQL is based on xtext by itemis and generates JPA-QL from SQL, storing data is still too complicated, serialization looked promising but was too unsecure and only entire objects can be serialized, Kryo, Fast Serializer, JetStream (renamed to Microstream) serializer, the database engine stores objects in any file storage, there is no impedance mismatch, the native Java storage engine, queries are performed with Java 8+ streams, JCA connector passes transactions and security context to the application server, JCA prototypical implementation, kubernetes persistent volumes, Bavarian Forrest is like Canada, the largest walking robot, Roding race car, being a TV host on Giga, constant 30k downloads and the XDev TV, DVDs were more successful than TV, JCon and the coding keynote, Java EE as secret weapon at JCon, stealing (adapting) the "no slides" ideas, the world first free, physical, Java magazine JAVAPRO with 8500 readers, community prefers Java-only conference,
Markus Kett on twitter: @MarkusKett. JetStream was renamed to MicroStream.

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


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Java EE, Jakarta EE and the Dead "javax"

Eclipse Foundation won't get the rights to use Oracle's Java trademarks with the following implications:

"...
  1. The javax package namespace may be used within Jakarta EE specifications but may be used “as is” only. No modification to the javax package namespace is permitted within Jakarta EE component specifications. Jakarta EE specifications that continue to use the javax package namespace must remain TCK compatible with the corresponding Java EE specifications.
  2. Jakarta EE component specifications using the javax package namespace may be omitted entirely from future Jakarta EE Platform specifications.
  3. Specification names must be changed from a “Java EE” naming convention to a “Jakarta EE” naming convention. This includes acronyms such as EJB, JPA or JAX-RS.
..."
[from https://eclipse-foundation.blog/2019/05/03/jakarta-ee-java-trademarks/].

Trademarks / licensing issues are quite complex, if you are interested in some background, listen to airhacks.fm episode: #13 From Java EE over EE4j to Jakarta EE with Mike Milinkovich

The javax namespace issue was known for years (see e.g. Reza's Joint Community Open Letter on Java EE Naming and Packaging), now we have a clear resolution. All the Java EE specifications / projects are going to be renamed with the "Jakarta" prefix (see Renaming Java EE Specifications for Jakarta EE) anyway.

Consistency, clarity and simplicity are crucial for the success of Jakarta EE. A clear cut e.g. renaming all packages from javax to e.g. jakarta would introduce a consistent look and feel and branding. A single package strategy is better, than a mix of javax and jakarta namespaces.

Forcing projects to migrate (=search "javax" and replace with "jakarta") or introducing breaking changes every 20 years (J2EE 1.2 was introduced in December 12, 1999) is acceptable. Such a migration could even introduce an opportunity to remove superfluous patterns, layers, indirections and libraries.


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

80% Code Coverage is Not Enough--Airhacks.fm Podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

An airhacks.fm conversation with James Wilson (@jgwilson42) about:

the result of pressing the break button on a BBC computer, and ZX Spectrum, Space Invaders with Basic, extending minecraft with Java, accidental tester career, best interviewees got programmer jobs, hackers and testers, developers like the happy path, unit test coverage is useless without good asserts, is 80% code coverage a valuable target?, code coverage was used as a motivation for writing tests, reflection utilities to increase code coverage, getters / setters never brake, Code as a Crime Scene book, methods longer than a screen are problematic, the ratio between trivial and good asserts, a good javadoc and unit tests follow similar principles, system tests are the most important one, unit testing is good for checking error scenarios, the more tests you have, the easier it is to locate errors, the Law of Triviality requires standard names for test categories, integration testing and system testing, reusing system tests as clients and stress tests, UK retailer goes down, take the max load and double it, jbmc is bytecode verification tool, diffblue cover generates unit tests, generating unit tests quickly for legacy backends, playground, What is the AI in “AI for Code”? blogpost, diffblue blog, @diffbluehq
James Wilson on twitter: @jgwilson42.

Checkout: javaeetesting.com - the online test about Unit-, Integration-, and Stress Testing and see you at airhacks.com.


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

MicroProfile and Jakarta EE -- The Lightweight Stuff Session

An itkonekt session for building a MicroProfile / Java EE application from scratch. Metrics, OpenAPI, FaultTolerance, Configuration, multi-server deployments, ThinWARs, and even reactive (easter) eggs included:

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


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Jakarta EE + MicroProfile Kickstarter

To create a Jakarta EE (Java EE) + MicroProfile Maven project replace both placeholders GROUP_ID and PROJECT_NAME and execute:

mvn archetype:generate -o -DarchetypeGroupId=com.airhacks -DarchetypeArtifactId=javaee8-essentials-archetype -DarchetypeVersion=0.0.4 -Darchetype.interactive=false --batch-mode -Dversion=0.0.1 -DgroupId=GROUP_ID -DartifactId=PROJECT_NAME

The maven archetype is available from Maven central, the sources from: https://github.com/AdamBien/javaee8-essentials-archetype

To continuously build and deploy the project, also to multiple servers, see wad.sh (a self contained JAR-application).

Checkout both in 3:27 minutes:

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


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Kafka vs. JMS/MQ--airhacks.fm podcast

Subscribe to airhacks.fm podcast via: spotify| iTunes| RSS

An airhacks.fm conversation with Andrew Schofield, Chief Architect, Event Streams at IBM about:

1982, Dragon 32 and Basic Programming with 12, starting with JDK 1.0, writing a JMS provider for WebSphere v6, no ceremony JMS, Apache Kafka considered simple, why writing a Kafka application is harder than a JMS application, there is a big architectural difference between Kafka and JMS, or message queuing and event stores, Kafka remembers historical data, JMS is about fowarding messages, with Kafka it is harder to write conversational systems, clustering singletons is hard, running Kafka on a single node is easy, "deliver once and only once" is the killer feature of persistent JMS queues, JMS topics are nicer - you can send messages to unknown receivers, the killer use cases for JMS and Kafka, JMS is good for system coordination and transaction integrity, Kafka is well suited for (IoT) event buffering and re-processability, 2PC, XA and the advantages of middleware, in distributed transactions everyone has to remember everything, we only need distributed and rock-solid persistence, kubernetes pods are stateless, challenges of using Kafka, setting up for production can take months for an average Java programmer with JMS background, restarting Kafka brokers can be challenging, in Kafka you are communicating with the cluster, MQ is a collection of individual queue managers, in MQ there is a directory of resources which knows where the queues are hosted.
Andrew on github, and LinkedIn.

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


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

Sending an InputStream to JAX-RS Resource

A JAX-RS resource accepting a plain InputStream:


@Path("uploads")
public class UploadsResource {

    @POST
    @Consumes("*/*")
    public void upload(InputStream stream) throws IOException {
        //consume input stream
        System.out.println("Read: " + stream.read());

    }    
}

...will consume any binary stream (e.g. file upload) of data as:

import java.io.IOException;
import java.io.InputStream;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Before;
import org.junit.Test;

public class UploadsResourceIT {

    private WebTarget tut;

    @Before
    public void init() {
        Client client = ClientBuilder.newClient();
        this.tut = client.target("http://localhost:8080/jaxrs-streaming/resources/uploads");
    }

    @Test
    public void sendStream() {
        InputStream stream = //...

        Response response = this.tut.
                request().
                post(Entity.entity(stream, MediaType.APPLICATION_OCTET_STREAM));
        assertThat(response.getStatus(), is(204));
    }    
}
The System Test is a Java SE client and therefore requires a JAX-RS API implementation (in our example: Apache CXF ):

<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-rs-client</artifactId>
    <version>3.3.1</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-rt-rs-extension-providers</artifactId>
    <version>3.3.1</version>
    <scope>test</scope>
</dependency>  
</dependencies>         

Project created with javaee8-essentials-archetype, the 3kB ThinWAR was built and deployed with: wad.sh in 2329ms

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


Cloudy Jakarta EE and MicroProfile: Microservices, Clouds and Beyond Jakarta EE / MicroProfile airhacks workshops at MUC airport, Winter Edition

airhacks.fm the podcast:

Stay in touch: airhacks.news.

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