Java, Distributed Computing, Hazelcast and Apache Kafka--an airhacks.fm podcast episode

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

The #100 airhacks.fm episode with Victor Gamov (@gAmUssA) about:
from C to enjoying opensource Java, JavaOne, Hazelcast, Confluent, Apache Kafka, and a bit of JMS (MoM) vs. Kafka (events)
is available for

Thorntails' EOL, Generic DAOs, Bulkheads, DTOs, Migrations, JPA, Transactions, Caches--or 77th airhacks.tv

Questions and topics (https://gist.github.com/AdamBien/bb28a209f2e1255b305d2b3c9357854e) for the 77th airhacks.tv questions and answers live show:

  1. The end of WildFly Swarm / Thorntail
  2. microprofile.training availability
  3. Quarkus on Raspberry PI
  4. How to test abstract GenericDAOs with a produced EntityManager
  5. MicroProfile Bulkheads Clarifications
  6. Customized serialization of master-detail entities
  7. DTO: Always, never of sometimes?
  8. Migrations away from Thorntail
  9. Conditional exposure of various datatypes via JAX-RS
  10. JPA with or without Liquibase and Flyway
  11. Managing distributed JPA caches
  12. JPA settings without persistence.xml
  13. Beans vs. Container Managed Transactions
  14. How to deal with application servers failed redeployments
  15. JAX-RS and serialization magic
  16. Parallel JSON-B and JAX-B serialization and naming strategies
  17. Max JDBC-connections and JPA transactions
  18. Number of beans in EJB pool and Payara
  19. An id-specific execution thread / pipeline

Join meetup.com/airhacks/ to get notified about future JUGs, sessions and airhacks.tv.

Any questions left? Ask now: https://gist.github.com/AdamBien/bb28a209f2e1255b305d2b3c9357854e and get the answers at the next airhacks.tv.

The End of Thorntail / WildFly Swarm

Thorntail (aka WildFly Swarm) is discontinued / EoL'ed:

"Rightsize Your Services" was Thorntail's slogan, which implied stock Jakarta EE services were oversized. Thorntail's idea was to package your application with "Just Enough Runtime" and save some bits of RAM and disk space. You were in complete control of the packaged libraries with WildFly Swarm / Thorntail, but you had also pick and maintain them.

Stock servers, like, e.g., WildFly, Payara, OpenLiberty, or TomEE, are small and fast enough without any additional up-front configuration. Just download, unzip, and go.

On the other hand, Quarkus' amazing build-time optimizations are extreme: a "hello, world" Quarkus MicroProfile application is smaller than an empty Tomcat or Jetty runtime.

Unfortunately: Thorntail was not as convenient as WildFly to start with and not as highly optimized as Quarkus. The "rightsizing" of the services was not worth the effort for the everyday use cases.

Wildfly Swarm and Thorntail came with MicroProfile API support out-of-the-box, which was suspiciously lacking in WildFly. In fact, WildFly was the only Jakarta EE application server shipping with only a small set of MicroProfile APIs. Now, the recent WildFly versions 19 and 20 are also shipping with full MicroProfile support as well.

Interestingly, the Thorntail's / WildFly Swarm's invention of hollow JARs, which separates the implementation and application logic in two deployment units, is supported by all application servers out-of-the-box.

Quarkus, unlike Thorntail, is not just an attempt to ship "Just Enough App-Server" by repackaging WildFly. Quarkus takes a mix of familiar Jakarta EE and MicroProfile APIs and completely revolutionizes the deployment and runtime behavior.

Now there is one recurring airhacks.tv question less to answer: "What are the use cases for ThornTail?"

WebSphere, Mainframes, JBoss, GlassFish and Vaadin Flow--airhacks.fm podcast episode

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

The #99 airhacks.fm episode with Simon Martinelli (@simas_ch) about:
software maintenance, what we can learn from COBOL and mainframe systems, WebSphere, GlassFish, JBoss, OR-mappers and code generation for Vaadin Flow
is available for

Quarkus, CORS and Missing HTTP Headers

A JAX-RS endpoint:


import java.net.URI;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/hello")
public class HelloResource {

    @POST
    @Produces(MediaType.TEXT_PLAIN)
        public Response post(String content) {
        var uri = URI.create("/id" + System.currentTimeMillis());
        return Response.created(uri).build();
    }    
}

with activated CORS in application.properties:


quarkus.http.cors=true        

...and accessed with browser's fetch from a different domain / port:


const sendPost = async  _ => { 
    const response = await fetch("http://localhost:8080/hello", {
        method: 'POST',
        body:'hello from js'
    });
    const headerContent = response.headers.get('Location');
    console.log('Location header',headerContent);
}

sendPost();    

won't reveal the headers: Location header null.

To access the headers from JavaScript, you will have to list them in Quarkus' configuration:


quarkus.http.cors.exposed-headers=Location    

Since curl is not a browser, the following command: curl -i -XPOST -d'hello' localhost:8080/hello always returns all headers:


HTTP/1.1 201 Created
Content-Length: 0
Location: http://localhost:8080/id1595909973814    

Looks like a bug, but it is actually a feature.

"Walk the Path--How JBoss Happened-an airhacks.fm podcast episode

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

The #98 airhacks.fm episode with Marc Fleury (@docfleury) about:
early Java, J2EE, Java EE days, the history of JBoss, professional and commercial opensource and a bit of music, physics and ...aliens.
is available for

Java 11: Extract File Name from Path

An alternative to lastIndexOf / substring combination to extract the file name from the path:


import java.nio.file.Path;

@Test
public void extractFileName() {
    var expected = "duke.html";
    var fqn = "/tmp/another/" + expected;
    
    var actual = Path.of(fqn).getFileName().toString();
    
    assertEquals(expected, actual);
}

Converting Dependencies Into ES 6 Modules with Snowpack

In this free, bonus video from the Apps with Web Components, redux and lit-html online workshop, I'm converting lit-html and redux dependencies into standard ES 6 modules with snowpack:

Also checkout other on-demand airhacks.io workshops.

The Lightguard and the Quarkus Cookbook--airhacks.fm podcast episode

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

The #97 airhacks.fm episode with Jason Porter (@lightguardjp) about:
Java, OpenSource contributions, JBoss, optimizations and simplifications with Java EE, MicroProfile and the Quarkus Cookbook
is available for

Building Applications with MicroProfile

NEW Building applications with MicroProfile (and a bit of Jakarta EE) on-demand 8h, continuous coding, 100 parts workshop is available: microprofile.training.

MicroProfile shares infrastructural APIs with Jakarta EE, like e.g. CDI, JAX-RS, JSON-B or JSON-P and comes with significant added value in areas like e.g. observability, robustness, configurability.

In this ~8 hour, ~100 parts on-demand airhacks.io workshop, I'm building a "cloud-native" application--a blog engine--featuring all MicroProfile APIs: OpenAPI with Swagger UI, JWT, Fault Tolerance, Configuration, Health, Metrics, Distributed OpenTracing, JSON-B, JSON-P, JAX-RS, CDI.

Java 11, Java 14 and GraalVM polyglot features were used as well.

Error- and exception handling, monitoring, synthetic transactions, Boundary Control Entity (BCE / ECB), REST-API design, refactoring, or design-decisions are covered on-the-go. Visual Studio Code, wad.sh, Docker and docker compose were used for development. Some airhacks.tv FAQ were answered as well.

See also other on-demand workshops from: airhacks.io and see you at virtual airhacks.live.

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