Skip to main content

Hashtag Jakarta EE #55

by Ivar Grimstad at January 17, 2021 10:59 AM

Welcome to the fifty-fifth issue of Hashtag Jakarta EE!

We are two weeks into the new year already, and I want to remind the specification teams that about the deadline for submitting a plan review in order to be a candidate for inclusion in the Jakarta EE 9.1 release. The deadline is January 31 as the timeline below shows.

The Jakarta EE Platform team are having weekly calls where various topics related to the platform specification are discussed. Please, do join this call if you are interested in participating in shaping the platform. Details for how to join can be found in the Jakarta EE Platform Calendar.

Barcelona JUG is the next stop on our Jakarta EE Virtual Tour. Join here! We really enjoy giving these talks, so please reach out if you are interested in hosting us at your JUG or MeetUp.

The first Jakarta EE Update Call of 2021 will happen on January 21! The topics we will cover in this call are the program plan and budget, the release plan for Jakarta EE 9.1 as well as upcoming events, programs and marketing campaigns. And, of course, there will be an opportunity to get your questions asked and answered.

Visit the Community Calendar to find the details about how to join the call.


by Ivar Grimstad at January 17, 2021 10:59 AM

Converting a byte[] to Stream

by admin at January 17, 2021 10:34 AM

The following snippet converts a byte[] array to a Stream using ByteBuffer:

import java.nio.ByteBuffer;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.junit.jupiter.api.Test;

public class ByteArrayTest {
    
    @Test
    public void byteArrayToStream(){
        byte bytes[] = new byte[]{0xC,0xA,0xF,0xE,0xB,0xA,0xB,0xE};
        var buffer = ByteBuffer.wrap(bytes);
        var message = Stream.generate(() -> buffer.get()).
                        limit(buffer.capacity()).
                        map(b -> Integer.toHexString(b)).
                        collect(Collectors.joining());
        System.out.println(message);
    }    

Output: cafebabe


by admin at January 17, 2021 10:34 AM

Plasma is the new "Hello,World"--airhacks.fm podcast

by admin at January 16, 2021 03:41 PM

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

The #123 airhacks.fm episode with Bert Jan Schrijver (@bjschrijver) about:
AI, Java EE, Java, serverless, Quarkus, and a bit of plasma
is available for download.

by admin at January 16, 2021 03:41 PM

Coffee with Thorben 2020-01-15 – Association Pitfalls & Enum Mappings

by Thorben Janssen at January 15, 2021 01:15 PM

The post Coffee with Thorben 2020-01-15 – Association Pitfalls & Enum Mappings appeared first on Thorben Janssen.

Subscribe on YouTube to not miss any video. Association Mapping Pitfalls The mapping of associations seems easy but there are several pitfalls you should avoid. Articles mentioned in the video: Ultimate Guide – Association Mappings with JPA and Hibernate Entity Mappings: Introduction to JPA FetchTypes Why you should avoid CascadeType.REMOVE for to-many associations and what […]

The post Coffee with Thorben 2020-01-15 – Association Pitfalls & Enum Mappings appeared first on Thorben Janssen.


by Thorben Janssen at January 15, 2021 01:15 PM

Avoiding Port Collisions by Launching Multiple Quarkus Instances in DEV Mode

by admin at January 15, 2021 05:51 AM

Quarkus started in development (quarkus:dev) mode with a JAX-RS endpoint exposed, opens two ports: (http) 8080 and (debug) 5005 per default.

You will have to assign distinct ports for every new launched instance. The http port is configurable in the application.properties: quarkus.http.port=8282 or environment entries (not suitable for our purpose), the debug port can be changed (-Ddebug=6000) or deactivated from the command line only: mvn compile -Ddebug=false quarkus:dev


by admin at January 15, 2021 05:51 AM

Early 2021 Java, Web, Architecture Events, Conferences And Workshops

by admin at January 13, 2021 09:32 AM

  1. WeAreDevelopers conference: 2021: Familiar APIs on Kickass Runtimes #slideless [online event]
    conference session 20 Jan 2021
    https://wearedevelopers.com/sessions/2021-familiar-apis-on-kickass-runtimes-slideless
  2. airhacks.tv: #83rd airhacks.tv Questions and Answers [online event]
    live questions and answers show 8 Feb 2021
    https://www.meetup.com/airhacks/events/275680793/
  3. JavaLand conference: Timesaving Metrics - In The Clouds #slideless [online event]
    conference session 16 Mar 2021
    https://programm.javaland.eu/2021/#/scheduledEvent/606335
  4. airhacks.live: Monoliths, Microservices, Serverless, Event-Driven,(...) Architectural Styles [online event]
    live, interactive, virtual workshop 16 Mar 2021
    https://airhacks.live
  5. airhacks.live: Building Event-Driven Applications with Streams, Logs and Messages [online event]
    live, interactive, virtual workshop 23 Mar 2021
    https://airhacks.live
  6. airhacks.live: Best Practices, Hacks and Frontend Patterns with Vanilla Web Components, redux and lit-html [online event]
    live, interactive, virtual workshop 15 Apr 2021
    https://airhacks.live
  7. airhacks.live: Building Mobile Apps with Vanilla Web Components, redux and lit-html [online event]
    live, interactive, virtual workshop 6 May 2021
    https://airhacks.live

by admin at January 13, 2021 09:32 AM

New Game New Luck | The Two Minutes Tuesday 015

by Markus Karg at January 12, 2021 10:00 PM

Sitting in a f*ing cold studio I wonder what video you would love me to record next!

The year 2021 is here, and I am bringing modern and cloud-native Java to some of my favorite open source projects: Speeding up Maven by using Multi-Release JARs with support for Java 9 and 10’s improved NIO API, quickly booting and small-footprint REST microservices with standalone JAX-RS 3.1 in Kubernetes, Java 11 support in Jakarta EE 9.1, and much more!

But where to start…? What videos do YOU like me to post next? Write your favorite video topics in the comments section belows this video!

CU!


by Markus Karg at January 12, 2021 10:00 PM

Community Projects & Contributors Take on Jakarta EE 9

by Chris Walker at January 12, 2021 04:22 PM

With the recent release of JakartaEE9, the future for Java has never been brighter. In addition to headline projects moving forward into the new jakarta.* namespace, there has been a tremendous amount of work done throughout the community to stay

by Chris Walker at January 12, 2021 04:22 PM

microprofile.training: Java 14 to Java 15 Update and MP REST Client CXF to RESTEasy Migration

by admin at January 12, 2021 03:42 PM

Update from Java 14 with --enable-preview to Java 15, fixing Apache CXFs:

java.lang.IllegalAccessError: class org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory$$Lambda$345/0x0000000800c309b0 tried to access protected method 'int org.apache.cxf.jaxrs.provider.ProviderFactory.compareCustomStatus(org.apache.cxf.jaxrs.model.ProviderInfo, org.apache.cxf.jaxrs.model.ProviderInfo)' (org.apache.cxf.microprofile.client.MicroProfileClientProviderFactory$$Lambda$345/0x0000000800c309b0 and org.apache.cxf.jaxrs.provider.ProviderFactory are in unnamed module of loader 'app'

by switching from cxf-rt-rs-mp-client to resteasy-client-microprofile.

A free bonus video from the microprofile.training video course:

Also checkout the corresponding repository: github.com/adambien/microprofile.training.


by admin at January 12, 2021 03:42 PM

Implementing Batch Jobs with Hibernate

by Thorben Janssen at January 12, 2021 01:00 PM

The post Implementing Batch Jobs with Hibernate appeared first on Thorben Janssen.

Like most Java developers, you probably use Hibernate directly or via Spring Data JPA to implement your application’s persistence layer. In general, this works very well for most use cases, but it causes some issues if you need to implement a batch job. This is because Hibernate, like most object-relational mapping frameworks, maps each database […]

The post Implementing Batch Jobs with Hibernate appeared first on Thorben Janssen.


by Thorben Janssen at January 12, 2021 01:00 PM

Java CLI Apps, Builds and jbang--airhacks.fm podcast

by admin at January 11, 2021 11:53 AM

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

The #122 airhacks.fm episode with Max Rydahl Andersen (@maxandersen) about:
creating Java Command Line Applications with and without jbang, new ways to launch and build Java applications with minimal requirements, how jbang happened, combining quarkus and jbang, and building serverless applications with quarkus and jbang
is available for download.

by admin at January 11, 2021 11:53 AM

Hashtag Jakarta EE #54

by Ivar Grimstad at January 10, 2021 10:59 AM

Welcome to the fifty-fourth issue of Hashtag Jakarta EE!

The main goal of Jakarta EE 9.1 is to support the Java SE 11 runtime. The APIs will still be compiled to Java SE 8 level in order to be usable to both Java SE 8 and Java SE 11. That means that there will not be need for any new releases for the individual specifications unless the specification teams have changes they wish to push forward. The absolute deadline for such plans to be put forward is January 31, 2021. See the timeline below.

Note that, it is up to the platform project to decide if any new versions should be included in the Jakarta EE 9.1 release even if a plan review is submitted within this deadline.

The Jakarta Contexts and Dependency Injection project continues with weekly calls with the goal to define a CDI Lite specification. Follow the discussions on the CDI Developer Discussions mailing list.

The Jakarta EE Virtual Tour continues in 2021. The ones we have planned so far are Silesia JUG (Jan 13), JUG Darmstadt (Jan 13), Barcelona JUG (Jan 20), and Chicago JUG (Feb 25). Please reach out if you are interested in hosting us at your JUG or MeetUp.

The jChampions Conference is starting next week. I will be a moderator for at least one of the sessions. Check out the schedule.


by Ivar Grimstad at January 10, 2021 10:59 AM

Java 15 vs Java 8 | Modern Java Features | Head Crashing Informatics 25

by Markus Karg at January 09, 2021 04:00 PM

Hey guys! How’s it going?

Backporting an application from Java 15 to Java 8 to convince you how much better coding in modern Java is!

Java 15’s modern language features and API enhancements makes coding so much better!

In this video I am migrating a JAX-RS application from Java 15 back to Java 8 to demonstrate how great the modern code is like, compared to the functionally identical code in the ancient pre-Java-9 world. You will see the difference in lines of codes spared due to using the var keyword, switch expressions and the Map.of() factory method – just THREE features out of a whole bunch of improvements! In the end, Java 8 was not just slower in its execution, it also forced you to write much more code, less comprehensible code, was more error-prone, and enforced complex construction, compared to Java 15. In addition, you had to scroll around a lot as you had to put some code into extra methods. Also the old-school code had much more potential bugs and even some were not even detectable at compile time!

Adopt modern Java NOW and start to use all the new features to get better, faster, more concise, more readable, and more bug-free Java code in less time!

You even can do that in existing libraries thanks to multi-release JARs, like Maven currently is adopting it, or on Jakarta EE 9.1 which officially supports Java 11 and will be released in few weels! Chances are good that your application server ALREADY allows modern Java, as e. g. Eclipse Jersey is supporting this already since several releases (this video actually proofs this)! And your favorite IDE definitively DOES support Java 15 already!

So there is no more excuse to wait any longer: Start using Java 15 NOW!

Stay safe and… Party on!


by Markus Karg at January 09, 2021 04:00 PM

Future.works: The Feel of Next Generation Java Cloud Native Runtimes

by admin at January 09, 2021 07:15 AM

Building a Java backend service with familiar APIs on a next generation runtime:


by admin at January 09, 2021 07:15 AM

Oracle Joins MicroProfile Working Group

by dmitrykornilov at January 08, 2021 06:02 PM

I am very pleased to announce that since the beginning of 2021 Oracle is officially a part of MicroProfile Working Group. 

In Oracle we believe in standards and supporting them in our products. Standards are born in blood, toil, tears, and sweat. Standards are a result of collaboration of experts, vendors, customers and users. Standards bring the advantages of portability between different implementations that make standard-based solutions vendor-neutral.

We created Java EE which was the first enterprise Java standard. We opened it and moved it to the Eclipse Foundation to make its development truly open source and vendor neutral. Now we are joining MicroProfile which in the last few years has become a leading standard for cloud-native solutions.

We’ve been supporting MicroProfile for years before officially joining the Working Group. We created project Helidon which has supported MicroProfile APIs since MicroProfile version 1.1. Contributing to the evolution and supporting new versions of MicroProfile is one of our strategic goals.

I like the community driven and enjoyable approach of creating cloud-native APIs invented by MicroProfile. I believe that our collaboration will be effective and together we will push MicroProfile forward to a higher level.


by dmitrykornilov at January 08, 2021 06:02 PM

Coffee with Thorben 2020-01-08 – DB Migration & Criteria SubQuery

by Thorben Janssen at January 08, 2021 02:00 AM

The post Coffee with Thorben 2020-01-08 – DB Migration & Criteria SubQuery appeared first on Thorben Janssen.

Subscribe on YouTube to not miss any video. Database Migration You have various options to automate the creation and update of your database. You can use JPA’s schema generation feature or use version-based database migration tools, like Flyway and Liquibase. I explained all of them in great detail here on the blog. You can find […]

The post Coffee with Thorben 2020-01-08 – DB Migration & Criteria SubQuery appeared first on Thorben Janssen.


by Thorben Janssen at January 08, 2021 02:00 AM

Web Components in 2021, MicroProfile vs. Jakarta EE, Authentication, Monoliths vs. Microservices, Bulkheads--or 83rd airhacks.tv

by admin at January 07, 2021 07:19 PM

The very first airhacks.tv 2021 episode with the following topics:
"Vanilla Web Components in 2021, MicroProfile vs. Jakarta EE, authentication and authorization, Java monoliths vs. microservices, hazelcast, bulkheads and executor services, the role of patterns, popularity of NetBeans, SpringBoot on Quarkus"

...is available:

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


by admin at January 07, 2021 07:19 PM

How to Use Eclipse Transformer to Convert a 3rd Party Library to the New Jakarta Namespace

by Rudy De Busscher at January 07, 2021 10:02 AM

Introduction

The release of Jakarta EE 9 breaks a tradition of Java Enterprise. A legal requirement of the Java EE code donation from Oracle to the Eclipse Foundation is the change of the namespace of javax to jakarta.


But the change of the package and XML namespace in Jakarta EE 9 is only the beginning. The change of the namespace allows for new development and functionality, but all frameworks and libraries using one of the Java Enterprise specifications also need to be adjusted to the new version.


by Rudy De Busscher at January 07, 2021 10:02 AM

Welcome to 2021

by Thorben Janssen at January 05, 2021 01:49 PM

The post Welcome to 2021 appeared first on Thorben Janssen.

Wow, 2020 has been a wild one. I’m sure all of us could talk for hours about the problems and all the stuff we were unable to do. So, let’s skip that and focus on the good parts. There were quite a few things that went unexpectedly well. I will summarize the most interesting ones […]

The post Welcome to 2021 appeared first on Thorben Janssen.


by Thorben Janssen at January 05, 2021 01:49 PM

Hashtag Jakarta EE #53

by Ivar Grimstad at January 03, 2021 10:59 AM

Welcome to the fifty-third issue of Hashtag Jakarta EE!

Happy New Year!

It’s 2021 and a year since I wrote the very first Hashtag Jakarta EE. I find it useful for myself to write these short recaps of what’s going on in the community, and I hope you enjoy them as well!

On the very last day of 2020, Eclipse GlassFish 6 was released! Go to glassfish.org/download to check it out. GlassFish 6 meets the compatibility requirements of Jakarta EE 9. Downloads are available for both the Platform and the Web Profile.

If you want to have a look at the other fishes in the Jakarta EE and MicroProfile space, take a look at A day of fishing with Jakarta EE and MicroProfile by Edwin Derks. In this blog post, Edwin describes the differences and similarities between GlassFish, Payara, and Piranha.

The Jakarta EE Virtual Tour continues in 2021. The ones we have planned so far are Silesia JUG (Jan 13), JUG Darmstadt (Jan 13), Barcelona JUG (Jan 20), and Chicago JUG (Feb 25). Please reach out if you are interested in hosting us at your JUG or MeetUp.


by Ivar Grimstad at January 03, 2021 10:59 AM

Building and deploying a Jakarta EE application on OpenShift

by WildFly Admin (francesco@mastertheboss.com) at December 30, 2020 02:26 PM

This is the second article about building and deploying a Jakarta EE service in the Cloud. In the first tutorial, we have covered How to build and deploy a Jakarta EE application on Kubernetes

Now we will show how to deploy the same application on OpenShift container application platform.


by WildFly Admin (francesco@mastertheboss.com) at December 30, 2020 02:26 PM

Peter McKinnon, Corona and Jakarta EE 9: Goodbye 2020! – The Two Minutes Tuesday 014

by Markus Karg at December 29, 2020 10:00 PM

Hey guys!

The year is nearly over, so it is time to look back what the past twelve months brought us.

A world-wide pandemic brought us COVID19, and with is masks, social distancing, home office – and THIS Youtube channel! Yes, indeed, I started this channel to better get through this hard times without losing touch to my audience. As it was impossible to do a gig on stage, I asked @Peilung0 to record shows where I do some coding and out of that we developed great formats: Head Crashing Informatics with its headliner “JAX-RS Done Right!”, The Two Minutes Thuesday, and the latenight live show “Tonite #WithMe”. Inspired heavily by our idols, Peter McKinnon, Edgar Wright and Gavin Hardcastle. And certainly 2020 brought us Jakarta EE 9, JAX-RS 3.0, and Java 15, which I talked a lot about in the past years on stage, and couldn’t resist to produce several videos about!

I really thank everybody for watching my shows, sending all the great comments and helping me pushing this forward. Now that the vaccine is here, 2021 will be really great, so while I really want to extend my Youtube activities, I really look forward to be back on stage and meet you face-to-face again at some programming coference or at a JUG.

CU!


by Markus Karg at December 29, 2020 10:00 PM

Improve Oracle JDBC performance by fetch size tuning

December 27, 2020 10:00 PM

By default, when Oracle JDBC driver executes query, it retrieves a result set of 10 rows at a time from the database cursor. Low fetch size value might cause more roundtrips to DB and this leads to a longer time to fetch results from queries. You can change the number of rows retrieved with each trip to the database cursor by changing the row fetch size value.

Statement, PreparedStatement, CallableStatement, and ResultSet provides next methods for dealing with fetch size:

void setFetchSize(int rows) throws SQLException

int getFetchSize() throws SQLException

Default fetch size value can be changed by defaultRowPrefetch connection property:

On Wildfly Application Server DataSource level by:

[standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleOraDS/connection-properties=defaultRowPrefetch:add(value=1000)

On Hibernate level by hibernate.jdbc.fetch_size property:

<properties>
  ...
  <property name="hibernate.jdbc.fetch_size" value="1000" />
  ...
</properties>

I did simple test:

@Test
public void defaultRowPrefetchTest() throws Exception {
   EntityManager em = Persistence.createEntityManagerFactory("myDSTestOra").createEntityManager();

   Long time = System.currentTimeMillis();

   Query q = em.createNativeQuery("SELECT * FROM MY_TABLE", Tuple.class);
   List<Tuple> resultList = q.getResultList();

   System.out.println(System.currentTimeMillis() - time);
}

And on my laptop, fetching of 16K records takes ~185 ms with default value and ~86 ms with defaultRowPrefetch = 20000. As you can see from the result - there is more than x2 performance improvement.

Source code of test case on GitHub


December 27, 2020 10:00 PM

Hashtag Jakarta EE #52

by Ivar Grimstad at December 27, 2020 10:59 AM

Welcome to the fifty-second issue of Hashtag Jakarta EE!

This is the last Hashtag Jakarta EE in 2020. But don’t worry, I will continue these weekly updates in 2021 as well.

This week, MicroProfile 4.0 was released! It’s been a long wait since the previous release (3.3) back in February. But now it’s here, the first release of MicroProfile following the MicroProfile Specification Process (MPSP).

This release contains updates to all specifications. See the MicroProfile Presentation for details. Note that the four Java EE 8 specifications that form the foundation of MicroProfile have been updated to the Jakarta EE 8 counterparts. This means that MicroProfile is still on the javax.* namespace. I expect that there will be a release during 2021 that will be based on Jakarta EE 9 versions of the specifications and by that support the jakarta.* namespace.

MicroProfile 4.0 will be covered in detail in the next Studio Jakarta EE LIVE as my guest on January 28th is Emily Jiang. Make sure to tune in to get all information about the 4.0 release directly from Emily.

As I mentioned in the previous Hashtag issue, I will participate in a Tech Summary Panel organized by the Barcelona JUG on December 29. In this event, we will summarize 2020 and look ahead towards 2021. It has an amazing lineup of speakers, and I am honored to be among them. You don’t want to miss this!

I’ll end this last Hashtag Jakarta EE of 2020 with a pointer to a great blog post by Payara‘s Steve Millidge: Cloud Myth: Ahead of Time Compilation Will Save You Money.


by Ivar Grimstad at December 27, 2020 10:59 AM

Microprofile metrics with Wildfly Application Server

December 26, 2020 10:00 PM

Any enterprise application can't be completely successful on production without good monitoring solution. For years vendors and developers provided custom tooling for it. Since Eclipse Microprofile Metrics specification we have a unified way to export monitoring data to the management agents and unified Java API, that developers can use to expose their telemetry data.

Wildfly application server provides microprofile metrics support, but unfortunately only for standalone configurations yet. In case domain mode you can provide necessary dependencies

dependencies {
    compile group: 'org.eclipse.microprofile.metrics', name: 'microprofile-metrics-api', version: '2.3'
    compile group: 'io.smallrye', name: 'smallrye-metrics', version: '2.4.0'
}

and then expose application scope metrics through custom endpoint like

import io.smallrye.metrics.exporters.JsonExporter;
import io.smallrye.metrics.exporters.OpenMetricsExporter;
...
@Singleton
@Path("/metrics")
public class MetricsTestResource {

  private OpenMetricsExporter openMetricsExporter = new OpenMetricsExporter();
  private JsonExporter jsonExporter = new JsonExporter();

  @GET
  @Path("/prmths")
  public String prometheus() {
    return openMetricsExporter.exportAllScopes().toString();
  }

  @GET
  @Path("/json")
  public String json() {
    return jsonExporter.exportAllScopes().toString();
  }

JVM and subsystems metrics will not be available by endpoint above, but them you can obtain through old good JMX.

Standalone server from the box provides metrics in prometheus format for all scopes over management interface (port 9990 ) using org.wildfly.extension.microprofile.metrics-smallrye extension and microprofile-metrics-smallrye subsystem.

kostenko@kostenko:$ curl http://127.0.0.1:9990/metrics/
# HELP base_classloader_loadedClasses_count Displays the number of classes that are currently loaded in the Java virtual machine.
# TYPE base_classloader_loadedClasses_count gauge
base_classloader_loadedClasses_count 11826.0
# HELP base_cpu_availableProcessors Displays the number of processors available to the Java virtual machine. This value may change during a particular invocation of the virtual machine.
# TYPE base_cpu_availableProcessors gauge
base_cpu_availableProcessors 8.0
...

For developers available next annotations (sorry for the low output examples values):

  • @Counted - counter, which counts the invocations of the annotated object.
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_total counter
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_total 1.0
    
  • @ConcurrentGauge - gauge which counts the parallel invocations of the annotated object.
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_current gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_current 1.0
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_max gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_max 1.0
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_min gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_min 0.0
    
  • @Gauge - gauge, which samples the value of the annotated object.
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_json gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_json 123.0
    
  • @Metered - meter, which tracks the frequency of invocations of the annotated object.
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_total counter
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_total 6.0
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_rate_per_second 0.209682602430885
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_one_min_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_one_min_rate_per_second 0.015991117074135343
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_five_min_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_five_min_rate_per_second 0.0033057092356765017
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_fifteen_min_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_fifteen_min_rate_per_second 0.0011080303990206543
    
  • @Metric - annotation that contains the metadata information when requesting a metric to be injected.
  • @Timed - timer, which tracks duration of the annotated object.
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_rate_per_second 0.09811766798116955
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_one_min_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_one_min_rate_per_second 0.030703655021877174
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_five_min_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_five_min_rate_per_second 0.0065567799035988195
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_fifteen_min_rate_per_second gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_fifteen_min_rate_per_second 0.002209922141215539
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_min_seconds gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_min_seconds 5.88813E-4
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_max_seconds gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_max_seconds 0.005724684
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_mean_seconds gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_mean_seconds 0.0030220556126073638
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_stddev_seconds gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_stddev_seconds 0.0025644006235855748
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds summary
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds_count 2.0
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds{quantile="0.5"} 5.88813E-4
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds{quantile="0.75"} 0.005724684
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds{quantile="0.95"} 0.005724684
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds{quantile="0.98"} 0.005724684
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds{quantile="0.99"} 0.005724684
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_seconds{quantile="0.999"} 0.005724684
    
  • @SimplyTimed - simple timer, which tracks duration and invocations of the annotated object.
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_total counter
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_total 1.0
    # TYPE application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_elapsedTime_seconds gauge
    application_org_kostenko_examples_microprofile_metrics_MetricsTestResource_prometheus_elapsedTime_seconds 0.005032859
    

Prometheus is a free software application used for event monitoring and alerting. It records real-time metrics in a time series database (allowing for high dimensionality) built using a HTTP pull model, with flexible queries and real-time alerting.

Let's setup above and check how metrics monitoring with Prometheus looks on practice:

wget https://github.com/prometheus/prometheus/releases/download/v2.23.0/prometheus-2.23.0.linux-amd64.tar.gz
tar xvfz prometheus-*.tar.gz
cd prometheus-*

To provide path to the metrics endpoint edit prometheus.yml and provide correct metrics_path and targets

# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['127.0.0.1:9990']

This is it! http://localhost:9090/graph :
wildfly-microprofile-metrics

Now our metrics is collecting and can be visualized over standard prometheus UI(shown above) or easy integrated with grafana

Source code of custom metrics endpoint example available on GitHub


December 26, 2020 10:00 PM

Merry X-Mas – Head Crashing Informatics 24 | Comedy Special

by Markus Karg at December 26, 2020 04:00 PM

Celebrate Christmas with Leo and Markus!

Leo and Markus are having fish for Christmas Dinner – but certainly rather unpleasant things do happen… Have fun watching our Head Crashing Informatics X-Mas Comedy Special!

Merry X-Mas!

Stay safe and… Party On!

Please support my work and become my patreon!


by Markus Karg at December 26, 2020 04:00 PM

A day of fishing with Jakarta EE and MicroProfile

by Edwin Derks at December 24, 2020 09:23 AM

Over the years, several implementations of the Jakarta EE and MicroProfile platforms have been developed by vendors. Some implementations are fully compatible with these platforms, others support a subset of specifications from the platforms, or are building on top of these. Implementations are often built as an open-source project and shipped by a vendor as a product for their customers. One of the things I noticed over the years, is that these projects are often named after animals. More particularly, there are currently three Jakarta EE / MicroProfile supporting runtimes available that refer to… fish. The members of this trio in question are:

Product Name Link
Eclipse GlassFish https://glassfish.org
Payara https://www.payara.fish
Piranha https://piranha.cloud

Since they share a common aspect in their product name, does that mean that they have something other in common, or is this just a coincidence? Let’s go over the high-level purpose and product definitions to find that out.

Eclipse GlassFish

If we look at the Jakarta EE compatible products page, Eclipse GlassFish shows up as both a Jakarta EE 8 and Jakarta EE 9 compatible application server. Looking at the history of Eclipse GlassFish, this is not a surprise. Until this project was moved from Oracle to the Eclipse Foundation in 2017, it was the reference implementation application server for Java EE. After moving Java EE to the Eclipse Foundation and rebranding the platform as Jakarta EE, the official concept of a reference implementation has been dropped. Although, technically speaking, Eclipse GlassFish remains the “unofficial” reference implementation of new versions of Jakarta EE. This means that for future versions of Jakarta EE, Eclipse GlassFish can be used to test-drive updates to, or implementation of, new specifications that are going to be supported by Jakarta EE. In addition, speaking hypothetically, if no other vendors would be around to implement Jakarta EE, the Eclipse Foundation would still have its own implementation of Jakarta EE under their own roof. This is important because, without any implementations, the Jakarta EE platform is just a set of specifications that be used to build enterprise applications, but not run them.

As a developer, you can easily download Eclipse GlassFish and use this application server to start a project in order to build enterprise applications. However, there are two things noteworthy that you should know:

  • This application server only implements the Jakarta EE platform. It lacks the cloud-native capabilities that the MicroProfile specifications add when compared to other application servers that implement both Jakarta EE and MicroProfile;
  • There is currently no commercial support available for Eclipse GlassFish. If you want to use this application server for your projects in production, that is perfectly fine. However, without such a support contract, in case you run into problems and are in need of a patch or fix, you are at the mercy of the community. You can file an issue in the open-source project or provide a patch there yourself in order to eventually release a new version of Eclipse GlassFish containing the fix.

Payara

Simply put, Payara is a commercially supported project that builds on Eclipse GlassFish while building their own commercial features on top of it. When we look at the Jakarta EE compatible products page, Payara shows up as a Jakarta EE 8 compatible application server. However, since Jakarta EE 9 has been released this month, and having a compatible Eclipse GlassFish application server around the corner, we can expect a Jakarta EE 9 compatible version of Payara shortly.

Over the years, Payara has built an ever-growing set of commercial features in their product. These features often aim at cloud-native development. This makes Payara a good fit for running instances in microservices architectures deployed on cloud environments. In addition, the company aims to support the latest LTS releases of Java, even providing support for various JVMs that you can use to run Payara. Speaking of running Payara, you also have the option of using the full-blown application server, or a slimmed down runtime in the form of Payara Micro. In case you are a fan of Uber/Fat JAR’s, you even have the option of generating such artifacts with Payara Micro.

In short, as a developer, you can use Payara for building and deploying enterprise applications in modern, cloud-native environments using some of your favorite flavors for packaging and running your applications. A few things noteworthy to mention for Payara are:

  • Payara provides support for migration from another application server to Payara in case you are interested in such a migration;
  • Payara supports both Jakarta EE and MicroProfile in order to make it a fit for running in cloud-native environments;
  • Payara provides several features for optimizing resource consumption of running Payara instances.

Piranha

Although this product references a fish, it is a new kid on the block and doesn’t share any particular existing base for Jakarta EE or MicroProfile. Piranha is not compatible with Jakarta EE or MicroProfile (yet) but supports a large part of the specifications in enterprise applications that you can build and run on Piranha. Like some other newer runtimes on the market that support Jakarta EE and/or MicroProfile specifications, it uses the best breeds of implementations or provides its own. Having that said, what are Piranha’s goals?

The product definition states that you can use Piranha to build Jakarta EE and MicroProfile based applications (among other frameworks or libraries), aiming for the smallest runtime possible in order to run them. Ship less, consume less, spend less seems to be the goal, which makes sense in cloud-native environments where spending resources cost money and spending less can be beneficial.

When you are interested in using Piranha as a developer, you should know these things:

  • Piranha is brand new and, as far as I know, doesn’t provide commercial support yet. However, if you are in the situation of building a non-mission-critical application from the ground up with cost efficiency in mind, starting off with Piranha should not hurt. With your feedback, you can help shape and mature the product, which can benefit you in the long run;
  • Piranha supports or integrates with other frameworks and libraries that might be a good fit for your project. This even includes GUI’s and testing, so be sure to check these out!

Conclusion

Next to these “fishy” runtimes from the Jakarta EE and MicroProfile ecosystems, there are of course several other runtimes available that you can check and try out in order to see if these are a fit for your project.

I’m curious if there will be any future implementations referring to a fish, and what the idea or vision behind the name would be. How would you name your “fishy” runtime? Please reach out to me on my Twitter when you have an idea, and who knows we can start a trend or project that makes it happen.


by Edwin Derks at December 24, 2020 09:23 AM

Very Merry Christmas with Jersey 2.33

by Jan at December 24, 2020 12:09 AM

Jersey 2.33 is out! As usually, right before Christmas we put together as many fixes and new features as possible to deliver new Jersey for you, the Jersey customers. During the work on Jersey 2.33, we already delivered Jersey 3.0.0, … Continue reading

by Jan at December 24, 2020 12:09 AM

Summing up Jakarta MVC 2.0

by Ivar Grimstad at December 23, 2020 08:18 AM

This post concludes the mini-series about how Jakarta MVC 2.0 moves through the steps involved in the Jakarta EE Specification Process (JESP).

All the posts are listed here, so bookmark this page for reference if you are involved in, or planning to be involved in a Jakarta EE specification.

Jakarta MVC 2.0 Plan Review
Jakarta MVC 2.0 Progress
Jakarta MVC 2.0 TCK
Jakarta MVC 2.0 Release Review
Jakarta MVC 2.0 Released

I have used Jakarta MVC as an example for a specification going through the steps involved in the JESP and blogged about them here. Check out the Jakarta MVC tag to get them all.


by Ivar Grimstad at December 23, 2020 08:18 AM

Snapshot from the set: X-Mas Episode

by Markus Karg at December 22, 2020 04:17 PM

Liked our Halloween movie? Stay tuned for more! We’re currently working on a Christmas episode! Meet Leo and me on December 26th!

Tuning lights at the X-mas set

by Markus Karg at December 22, 2020 04:17 PM

CometD 5.0.3, 6.0.0 and 7.0.0

by simon at December 21, 2020 09:31 PM

Following the releases of Eclipse Jetty 10.0.0 and 11.0.0, the CometD project has released versions 5.0.3, 6.0.0 and 7.0.0. CometD 5.0.x Series CometD 5.0.x, of which the latest is the newly released 5.0.3, require at least Java 8 and it

by simon at December 21, 2020 09:31 PM

How to build and deploy a Jakarta EE application on Kubernetes

by WildFly Admin (francesco@mastertheboss.com) at December 21, 2020 09:12 AM

In this series of tutorials, we will show how to create and deploy a Jakarta EE service in a Cloud environment. Within this first article, we will learn how to deploy a WildFly application on Kubernetes using Minikube and JKube Maven plugin. In the next article, we will target OpenShift as Cloud environment.

Let's get started. The first step is obviously installing Kubernetes so that we can deploy applications on top of it.


by WildFly Admin (francesco@mastertheboss.com) at December 21, 2020 09:12 AM

Hashtag Jakarta EE #51

by Ivar Grimstad at December 20, 2020 10:54 AM

Welcome to the fifty-first issue of Hashtag Jakarta EE!

As we are ramping down to close 2020 and recharge for 2021, there are still things going on in the community. First, I would like to point you to the Studio Jakarta EE LIVE I had with Dalia this week where we talked about tooling for Jakarta EE.

Stay tuned for more Studio Jakarta EE LIVE coming up next year.

We released Jakarta MVC 2.0 yesterday! This was the second release since moving to Eclipse Foundation and Jakarta EE. With this release, we have moved to the jakarta.* namespace. Eclipse Krazo, the compatible implementation runs on both GlassFish and WildFly. OpenLiberty is on its way.

Jakarta MVC 2.0 will be featured in a session called “OpenDDR and Jakarta MVC” that I am co-speaking with Werner Keil at Java2Days on December 22nd.

On December 29th, I am participating in a Tech Summary Panel organized by the Barcelona JUG. In this event, we will summarize 2020 and look ahead towards 2021. It has an amazing lineup of speakers, and I am honored to be among them. You don’t want to miss this!


by Ivar Grimstad at December 20, 2020 10:54 AM

Artikel in iX 1/2021 zu Jakarta EE 9

by Markus Karg at December 19, 2020 03:34 PM

Ausgabe 1/2021 der iX enthält einen Beitrag von mir zu Jakarta EE 9. Viel Spaß beim Lesen!


by Markus Karg at December 19, 2020 03:34 PM

Jakarta MVC 2.0 Released

by Ivar Grimstad at December 19, 2020 10:22 AM

Jakarta MVC 2.0 passed the release review ballot and is now ratified as a final specification according to the Jakarta EE Specification Process (JESP).

The last steps for the project team after the ballot are to release the staged artifacts to Maven Central and verify that all published information is correct. That has now been done, and I have listed information about how to obtain the artifacts below.

The MVC 2.0 API maven coordinates are:

<dependency>
  <groupId>jakarta.mvc</groupId>
  <artifactId>jakarta.mvc-api</artifactId>
  <version>2.0.0</version>
</dependency>

The Eclipse Krazo 2.0.0 maven coordinates are:

<dependency>
  <groupId>org.eclipse.krazo</groupId>
  <artifactId>krazo-core</artifactId>
  <version>2.0.0</version>
</dependency>

In addition to the core component, you will also need a dependency specific to the Jakarta EE 9 implementation you are using. See Eclipse Krazo 2.0.0 download page for more information about this.

The MVC 2.0 TCK can be downloaded from the Eclipse Download area. It can also be obtained from Maven Central.

I have used Jakarta MVC as an example for a specification going through the steps involved in the JESP and blogged about it here. Follow the Jakarta MVC tag to get them all.


by Ivar Grimstad at December 19, 2020 10:22 AM

Pavimentando el Camino con Jakarta EE 9 and Apache TomEE

by Cesar Hernandez at December 18, 2020 10:05 AM

El 12 de Octubre del 2020 se llevó a cabo la primera edición virtual del JakartaOne en Español, el evento reunió a más de 500 asistentes y 9 comunidades de Java de habla hispana. 

La agenda del evento ofreció a los asistentes y comunidades una amplia gama de temas relacionados a las aplicaciones Java Empresarial, nubes nativas, micro servicios entre otros.  

En esta edición tuve la oportunidad de compartir la sesión “Pavimentando el camino con Jakarta EE 9 and Apache TomEE” la cual ofrece un breve recorrido de cómo Jakarta EE ha evolucionado en los últimos 20 años y la relación entre sus pilares: Especificaciones, Kits de Compatibilidad de Tecnología, activos de código abierto, herramientas de proveedores e implementaciones. La parte demostrativa incluyó el reto que el lanzamiento de Jakarta EE 9 tiene en referencia al cambio de paquete javax.* a jakarta.* e incluyó ejemplos de cómo poder migrar tus aplicaciones de versiones anteriores de aplicaciones Java Empresariales. 

 

The post Pavimentando el Camino con Jakarta EE 9 and Apache TomEE appeared first on Tomitribe.


by Cesar Hernandez at December 18, 2020 10:05 AM

Planning for Jakarta EE 9.1

by Ivar Grimstad at December 18, 2020 09:11 AM

In the December 15 Platform Project call, the platform team made a couple of important decisions regarding the upcoming Jakarta EE 9.1 release.

The goal of Jakarta EE 9.1 is to ship Java SE 11 support as soon as possible. That means that we want to minimize releasing new API artifacts unless necessary. Specification teams are able to make changes and do minor updates if they wish, or have to in order to support Java SE 11. In order to avoid putting these on the critical path of the release, the platform team decided to enforce a deadline for announcing these changes. The deadline for starting a plan review for potential inclusion in Jakarta EE 9.1 is set to January 31, 2021.

Any API team that wants to release a new version MUST engage in a plan review by the end of January 2021 in order to be considered for inclusion in Jakarta EE 9.1.

The Jakarta EE Platform Team

Please refer to the December 15 meeting minutes for details.

The plan for Jakarta EE 9.1 has not been finalized yet but will be communicated on the Jakarta EE Platform Project pages shortly. I have taken the liberty to sketch a very loose outline for the plan below.

The only date communicated so far is the deadline for engaging in a plan review for specification projects. That deadline is January 31, 2020. The actual release date (T) is not decided yet, but it is a fair assumption that the Jakarta EE 9.1 specification will go on ballot for release review about 14 days prior to this date. Any specifications that are updated for this release will have to go to ballot before this. Preferably as soon as possible, but no later than 14 days before the platform ballot starts in order to complete on time.

A plan review is an important step in the Jakarta EE Specification Process (JESP). This is where a project team presents its plans for the Specification Team and the community for feedback.

A plan review is initiated by creating a Pull Request to the specifications repository. To make it easier for a project team to know what information to include in a plan review, the specification committee has created an example of such a pull request. The example PR contains a checklist for the project team:

## Specification PR template
When creating a specification project plan review, create PRs with the content defined as follows.

Include the following in the PR:
- [ ] A directory in the form wombat/x.y where x.y is the release major.minor version.
- [ ] An index page wombat/x.y/_index.md following [template](https://github.com/jakartaee/specification-committee/blob/master/spec_page_template.md)
- [ ] Title should be on the form "Jakarta Wombat X.Y (under development)"
- [ ] Includes a plan for the release. Usually, a couple of statements is enough. Otherwise, a link to a document describing the release.
- [ ] Includes a detailed description of any backward incompatibility (Mark with **N/A** and check if none)
- [ ] Declares optional features if there are any (Mark with **N/A** and check if none)
- [ ] Includes minimum Java SE version
- [ ] Describe any updates or required changes including splitting out the TCK (Mark with **N/A** and check if not planned)
- [ ] Link to updated release record

The planned version’s _index.md file should look something like this:

---
title: "Jakarta Wombat 1.0 (under development)"
date: 2099-12-01
summary: "First release of Jakarta Wombat"
---

Jakarta Wombat 1.0 lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

*Minimum Java SE Version:* **17**

* [Jakarta Wombat 1.0 Release Record](https://projects.eclipse.org/projects/ee4j.wombat/releases/1.0)

Instructions for Jakarta EE Specification projects regarding reviews were communicated to project leads on the Jakarta EE Specification Project Leads mailing list in this message from the Specification Committee.


by Ivar Grimstad at December 18, 2020 09:11 AM

Reactive HttpClient 1.1.5, 2.0.0 and 3.0.0

by simon at December 15, 2020 06:53 PM

Following the releases of Eclipse Jetty 10.0.0 and 11.0.0, the Reactive HttpClient project — introduced back in 2017 — has released versions 1.1.5, 2.0.0 and 3.0.0. Reactive HttpClient 1.1.x Series Reactive HttpClient Versions 1.1.x, of which the latest is the

by simon at December 15, 2020 06:53 PM

Drawing winners of Pocket Sky give-aways – The Two Minutes Tuesday 013

by Markus Karg at December 15, 2020 09:49 AM

Hey guys!

Watch me drawing the winners of two Pocket Sky wearables donated by Active Wearables (https://www.pocket-sky.com/). The reactions to the review video was overwhelming! Thanks to everybody! Unfortunately we only have TWO give-aways, so good luck with the drawing!

Merry X-mas to everybody!

While Active Wearables donated the two free give-aways, I bought my own Pocket Sky from my own money and did not get paid in any form for this episode. So be assured, the test result is my own, even if officially the video is marked as sponsored due to that.

I do not get paid for this show, nor do I receive free gadgets, and I am in no way afiliated to the vendor of “Pocket Sky”. I just want to help people suffering from these symptoms.

If you like my show, please subscribe to my channel, or become a patreon (https://www.patreon.com/mkarg).

CU!


by Markus Karg at December 15, 2020 09:49 AM

[DEUTSCH!] Live-Interview mit Wolfgang Taschner FR 18.12. 20:00 CET | Tonite With Me

by Markus Karg at December 14, 2020 06:26 PM

Interviewe kurz vor Weihnachten #MitMir Wolfgang Taschner AUF DEUTSCH, den ehemaligen Chefredakteuer der HC und Java aktuell, indem Du Fragen in den Live-Chat schreibst!

Wolfgang ist ein Urgestein der deutschsprachigen Heimcomputer-Szene und hat durch seine Zeitschrift HC viele an das Programmieren und Hardware-Basteln herangeführt!

Ich bin stolz darauf, einen der “Macher” meiner ersten Computer-Jahre live in meiner Late-Night-Show zu haben und freue mich sehr auf Euere Fragen!

This live episode of Tonite #WithMe is in GERMAN only, but you can write questions in English, also. Thank you for your kind understanding.


by Markus Karg at December 14, 2020 06:26 PM

Hashtag Jakarta EE #50

by Ivar Grimstad at December 13, 2020 10:54 AM

Welcome to the fiftieth issue of Hashtag Jakarta EE!

Wow, fifty hashtags so far! Tuesday was a big day for the Jakarta EE community. That was the day of JakartaOne Livestream 2020. With this event, we officially announced Jakarta EE 9, even though it has been available in Maven Central since November 20th.

If you didn’t have the opportunity to attend or want to see some of the talks again, they are all available on the Jakarta EE YouTube channel. Please visit jakarta.ee to find out more about Jakarta EE, and specifically the specifications section for all resources regarding the Jakarta EE specification.

I am also happy to be back at JavaLand 2021, where I will give a talk about Jakarta EE. It will be a hybrid event, and it looks like I will do my talk remotely. I have been a speaker at every edition of JavaLand so far and always joined the JavaLand jogging on Wednesday morning. This year, I will have to do a run in the morning from my home in order to keep the spirit going.

On Thursday, I have Dalia as a special guest in Studio Jakarta EE LIVE. We will talk about tooling support for Jakarta EE. Dalia is a Developer Advocate at JetBrains and will demo the support offered by IntelliJ IDEA for Jakarta EE in this session.

In the video below, Dalia shows how easy it is to get started with Jakarta EE 9 in IntelliJ IDEA.


by Ivar Grimstad at December 13, 2020 10:54 AM

JAX-RS Done Right! (X. – Custom Entity Providers)

by Markus Karg at December 12, 2020 04:00 PM

Hey guys! How’s it going?

Let’s write custom entity providers to process any document formats we like with JAX-RS – without sacrifying SoC!

Today’s episode of “JAX-RS Done Right!” keeps Separation of Concerns while adding support for ANY document type – even your own fancy one! So the application only has PURE domain code when it comes to handling http bodies, while the dealing with the new data type happens in separate classes. The key for this are CUSTOM Entity Providers (i. e. renderers and parsers for a combination of Java class and media type OTHER than plain text, json or xml). This is much easier as you might expect, makes you application very flexible, but still keeps the domain logic PERFECTLY READABLE even when you add MANY data types!

This builds upon an early episode, in which we learned what Entity Providers are in general, and Default Entity Providers for plain text, json and xml in particular.

Code example can be found on Gitlab: https://gitlab.com/mkarg/jaxrs-done-right

Stay safe and… Party on!


by Markus Karg at December 12, 2020 04:00 PM

Tooling for Jakarta EE

by Ivar Grimstad at December 10, 2020 07:23 PM

I am happy to announce the first Studio Jakarta EE LIVE! And what a start! I have the honor of having Dalia Abo Sheasha as my special guest in this session. Dalia works as Developer Advocate at JetBrains, and the topic of this LIVE session is tooling support for Jakarta EE.

Feel free to use the comments section on YouTube to ask questions for Dalia and me. You can start right now and continue until the broadcast ends. Of course, you may even ask questions after, but the chances of getting them answered are much higher during the broadcast.

My plan is to host Studio Jakarta EE LIVE with invited guests regularly. I haven’t decided the cadence yet, so your best option is to follow Studio Jakarta EE on YouTube and bookmark the Studio Jakarta EE LIVE playlist. Also, make sure to follow Jakarta EE and Ivar Grimstad on Twitter.


by Ivar Grimstad at December 10, 2020 07:23 PM

What's New in the Payara Platform December Release?

by Dominika Tasarz at December 09, 2020 02:00 PM

The last Payara Platform release of 2020 is here!  With this patch release of Payara Platform Enterprise 5.23.1, we're introducing more improvements and component upgrades to Payara InSight as well as a couple useful bug fixes. Meanwhile, the Payara Platform Community 5.2020.7 introduces some improvements and additions to the MicroProfile specs in preparation for the upcoming MicroProfile 4.0 release. We are also happy to confirm that Payara Platform Web Profile is now Jakarta EE 8 compatible!

You can download Payara Platform Community 5.2020.7 here and request Payara Platform Enterprise 5.23.1 here. 

Read more below to find out the details.


by Dominika Tasarz at December 09, 2020 02:00 PM

Payara Services Celebrates the Release of Jakarta EE 9

by Priya Khaira-Hanks at December 08, 2020 12:00 PM

As leading contributors to the Jakarta EE project, Payara excitedly welcomes Jakarta EE 9 - now officially released! 

Announced at today’s Jakarta One Livestream, the headline breaking change is the move from the package namespace javax to jakarta across the Jakarta EE 9 Platform, Web Profile specifications, and related TCKS. 

Through our involvement in the Eclipse Foundation Jakarta EE Working Group, we are proud to play a major role in shaping, improving and championing Jakarta EE 9. The specifications will be key to the evolution of cloud native technologies for Java, also central to Payara's mission. 


by Priya Khaira-Hanks at December 08, 2020 12:00 PM

Jelastic Announces Jakarta EE 9 Cloud Availability Across Network of Hosting Service Providers

by Tetiana Fydorenchyk at December 08, 2020 11:35 AM

Jelastic, multi-cloud PaaS provider and Jakarta EE Working Group member, today announced full compatibility with newly-released Jakarta EE 9 specifications. The transition from javax.* package namespace to jakarta.* was introduced to power the evolution of cloud native technologies for Java. Jelastic is the first cloud platform that has already made this release available for the customers across a wide network of distributed hosting service providers. “Jelastic is the first and only cloud vendor to answer our call-to-action to support the new jakarta.* namespace, including both Tomcat 10 and TomEE 9 milestones by the Jakarta EE 9 release date. If we want Java-based standards to continue to exist in our industry, we need all cloud platforms to follow their example and collaborate with implementors to ensure that Jakarta EE thrives,” said David Blevins, Tomitribe founder and CEO.
jakarta ee 9 release

by Tetiana Fydorenchyk at December 08, 2020 11:35 AM

Payara Server Web Profile is Jakarta EE 8 Web Profile Compatible

by Debbie Hoffman at December 07, 2020 02:34 PM

Payara Server Web Profile (Enterprise Edition 5.23.0 and Community Edition 5.2020.6), has passed the approximately 18,000 open sourced licensed Jakarta EE 8 TCKs for the Web Profile Platform and is now a Jakarta EE 8 Web Profile compatible implementation. Payara Server is available for download here.


by Debbie Hoffman at December 07, 2020 02:34 PM

Hashtag Jakarta EE #49

by Ivar Grimstad at December 06, 2020 07:57 AM

Welcome to the forty-ninth issue of Hashtag Jakarta EE!

Big day on Tuesday! The second edition of JakartaOne Livestream happens on December 8, 2020. Make sure you are registered!

I am really looking forward to hosting this event together with Tanja. We have an amazing lineup of speakers and lots of great Jakarta EE and MicroProfile content prepared for you.

Between each session, we will return to Studio Jakarta EE for lightning talks, interviews, tech demos discussions, and awards. And, of course, there will be cake!

The Jakarta MVC 2.0 release review ballot has started. The ballot period is 14 days, so it will conclude on December 17, 2020. We are extremely happy to be able to embrace the jakarta.* namespace and run on top of Jakarta EE 9 so quickly after its release.

Eclipse GlassFish 6.0.0 is just around the corner. The release candidate (RC2) has been available for a while, and the team is working on wrapping up the last bits and pieces to release the final version. Hopefully, it will be available for download on Tuesday.


by Ivar Grimstad at December 06, 2020 07:57 AM

Happy Jakarta EE 9 with Jersey 3.0.0

by Jan at December 03, 2020 11:05 PM

Jakarta EE 9 and Jersey 3.0.0 are here. The transition to a new jakarta package based APIs took a great amount of work, from the whole Jakarta EE community. It started in the spring of the year 2020, and finally, … Continue reading

by Jan at December 03, 2020 11:05 PM

Introducing TCK.work

by David Blevins at December 02, 2020 06:12 PM

I’d like to share with everyone a system we’ve set up to help projects get faster TCK results, starting of course with Apache TomEE.

We’ve had this system for a while, but were unable to open access due to the legal restrictions around access to the TCK and results. Now that all of this is public we can finally make it available.

This installation is dedicated to open source projects and per each TCK run will spin up 100 m3.medium spot instances in AWS to chew through 95% of the TCK in about 2 hours. A handful of tests take much longer. Note it still looks and feels like an internal tool and currently only supports TomEE, but we hope to make improvements over the coming months and expand it to cover more Apache projects incorporated in TomEE.

Enabling The Community

We’re sharing this to hopefully enable the community to realistically help with TCK certification. Running individual tests on your own machine is very realistic and something anyone can do. However, running the whole TCK on your machine is not realistic — unless you don’t need your machine for a week as that’s how long it would take to complete one box of almost any size.

The goal is the community can use this to see what work needs to be done (which tests are failing) and then dig in by running that test on your own machine using the official Apache TomEE TCK setup (https://github.com/apache/tomee-tck).

With that in mind here are some of the more critical features to help you move the needle on our TCK progress.

Main Page

The main page https://tck.work/tomee/projects shows currently 3 projects and it’s specific status, JVM, version and container.

  • webprofile-jakartaee-8: TCK runs targeting Jakarta EE 8 compliance on TomEE 8.x
  • custom-jakartaee-8: One-off or partial runs of the Jakarta EE 8 TCK
  • webprofile-jakartaee-9: TCK runs targeting Jakarta EE 9 compliance on TomEE 9.x

More flavors of projects/builds will likely be added as the project decides to target other JVMs, profiles, etc.

Analyze Issues

At the bottom of most TCK results page there will be a link ‘analyze issues’ that will bring you to a page like this:

This page is created by looking at the stack traces printed by each failing test and counting and ranking them. For example, one of the exceptions we’re seeing is a NoClassDefFoundError affecting these 54 tests:

Filtering by pass/fail status

At the top of most TCK results pages there are “PASSED” and “FAILED” links that will allow you to filter tests by status. This is important for the above feature as many passing tests do throw exceptions. You’ll want to make sure to click “FAILED” after or before you navigate to “analyze issues.”

Filtering by package

In the upper right of most test results pages you’ll see “Subsections” showing a list of java packages under the current test package. Some test sections have many subsections such as EJB lite:

View output

The “Tests” table on every test results page has a “Package”, “Test” and “Result” columns.

  • Click “Test” to see TCK output for that exact test. This is the log output of the TCK itself and should be your first thing to examine.
  • Click “Package” to see any *.log files created and uploaded during the testing of that section. This is where you’ll find maven output, server log files, etc.

Running and Fixing a test

This system does not help you run an individual test. That is done on your machine via the project’s official TCK harness:

This system also uses the above harness and simply does a checkout and build of that just like any of us would. The best way to make progress fixing a test is on your machine.

You Can Make A Difference

You might be thinking, “can I realistically help with something as complicated as passing a TCK? Isn’t that just for full-time developers?” Here’s a fact you may not know:

Apache TomEE was built and reached Java EE 6 Web Profile certification without even a single full-time developer.

When Apache TomEE 1.0 milestone 1 was announced in 2011 there was no Tomitribe and all of us worked in our spare time, including me. In the very first Tomitribe blog ever, “Who Are The Real Heroes Of Open Source?” we tell a story about many of us in Apache taking a vacation to travel to Tours, France, and hack on Apache TomEE and the TCK together for a week. It was the first time most of us had never met in person and to this day it is still one of the project’s most cherished memories.

Now that the TCKs are open source, this adventure is open to everyone.

With great confidence, I can say my entire career was made possible by contributing to open source. Famous open source hackers are open source hackers first. That opportunity is open to everyone and it is entirely what you make of it.

We hope this enables a new generation of open source hackers to dig in, forge their way and become tomorrow’s leading experts in all things Jakarta EE. More than that, we hope this enables true collaboration and the kind of personal and community bond only possible from making a brave jump and achieving the impossible together.

With that said, let’s do the impossible and we’ll see you on the Apache TomEE dev list!

The post Introducing TCK.work appeared first on Tomitribe.


by David Blevins at December 02, 2020 06:12 PM

Jakarta EE Community Update November / December 2020

by Tanja Obradovic at December 01, 2020 08:14 PM

This month is certainly focused on celebrations all around! We are super excited about the Jakarta EE 9 release and upcoming JakartaOne Livestream 2020 event! Register Now and join us on December 8th to learn more about Jakarta EE 9 and find out what’s coming in 2021.

 

Welcome to Jakarta EE 9

As indicated previously on November 20th, Jakarta EE 9 specifications were completed! This release will be the base for any future development and innovation for Cloud Native Java. Congratulations to the Jakarta EE Working Group and broader community that made this releaselse happen! Special thanks goes to Kevin Sutter (IBM), along with Steve Milledge (Payara), who were leading the effort on this release.

Please check out the links below.

Platform Spec:  https://jakarta.ee/specifications/platform/9/

Web Profile Spec:  https://jakarta.ee/specifications/webprofile/9/

Jakarta EE Specs Home:  https://jakarta.ee/specifications/

The first compatible product for Jakarta EE 9 release is Eclipse GlassFish v6-RC2, but we are expecting many others to follow and we’ll be publish them at Compatible Products page.

 

Encourage All to Adopt New jakarta.* Namespace

If you have migrated your custom application to Jakarta EE 9 and adopted new jakarta.* namespace or you are a vendor that is adopting the new jakarta.* namespace, please let us know. You can tweet about it and use #embraceJakarta and we’ll be happy to promote you!

To help vendors make the transition, the Jakarta EE community has developed a data sheet summarizing the namespace migration challenge and opportunity. You can download the datasheet here.

 

Register for JakartaOne Livestream Today

Please visit https://jakartaone.org/2020/ for more information on the Program, speakers and all Studio Jakarta EE sessions with Ivar Grinstad, I (Tanja Obradovic) and special guests!

Register today to reserve your spot. JakartaOne Livestream is a great way to learn more about the technical benefits and architectural advances that become possible with cloud native Java, Jakarta EE, Eclipse MicroProfile, and Java EE technologies.

Remember this is not just a technical virtual conference, but a celebration of the community achievements, collective work and effort delivering Jakarta EE 9 release! We celebrated the milestone release with a cupcake - for this one I will bake a cake and I surely hope you will do the same. If you do so please send us pictures so we can share with the community! Let’s see who’s cake will win the best Jakarta EE 9 cake title! Here is something that can help you decorate your cake.

For live event updates, speaker announcements, news, and more, follow @JakartaOneConf on Twitter.

 

Book Your Jakarta EE Virtual Tour

Jakarta EE Developer Advocate, Ivar Grimstad, and I (Tanja Obradovic) are continuing with Jakarta EE Virtual Tour, providing one-hour talks on Jakarta EE 9 and beyond to Java communities.

 January 2021 is already quite busy with the scheduled sessions, but don’t hesitate to contact me (tanja.obradovic@eclipse-foundation.org) if you’d like us to present at your Java User Group (JUG) or Meetup event throughout 2021.

 

 

Stay Connected With the Jakarta EE Community

The Jakarta EE community is very active and there are a number of channels to help you stay up to date with all of the latest and greatest news and information. Subscribe to your preferred channels today:

·  Social media: Twitter, Facebook, LinkedIn Group

·  Mailing lists: jakarta.ee-community@eclipse.org, jakarta.ee-wg@eclipse.org, project mailing lists, slack workspace

·  Newsletters, blogs, and emails: Eclipse newsletter, Jakarta EE blogs, Hashtag Jakarta EE

·  Meetings: Jakarta Tech Talks, Jakarta EE Update, Jakarta Town Hall, and Eclipse Foundation events and conferences

You can find the complete list of channels here.

 To help shape the future of open source, cloud native Java, get involved in the Jakarta EE Working Group

To learn more about Jakarta EE-related plans and check the date for the next Jakarta Tech Talk, be sure to bookmark the Jakarta EE Community Calendar.

 


by Tanja Obradovic at December 01, 2020 08:14 PM

The Payara Monthly Catch from November 2020

by Priya Khaira-Hanks at December 01, 2020 10:43 AM

The big news from this month was the General Availability release of Jakarta EE 9 on November 20th, moving to the jarkarta namespace once and for all. This will be followed by an official release at the Eclipse Foundation's JakartaOne Livestream on December 8th - at which our Founder Steve Millidge is a key speaker. You can register to attend here
 
It's also been a month of exciting news for Payara as a business, as we've extended our partnership with Azul Systems and taken key steps towards beta testing of our exciting Payara Cloud project, all alongside our regular monthly platform release. We've also been excited to see Payara used as examples in Community materials such as Otávio Santana , Geovanny Mendoza, and Aristides Bravo's new Jakarta EE guide, in various learning materials and blogs, and in a Microsoft tutorial! 
 
If you enjoy the (fish!) food for thought in the articles below, make sure you are following us on Twitterfor updates as they come! 

by Priya Khaira-Hanks at December 01, 2020 10:43 AM

Infinispan Server as Wildfly remote cache container for your Jakarta EE application

November 28, 2020 10:00 PM

pager

Recently i wrote a few articles about using infinispan cache based on Wildfly infinispan subsystem. But even though Wildfly provides well cache containers management support, - from the high load and high availability points of view, make sense to take a look to separate clustered cache instances.

PROS:

  • Heap, threads, GC pauses separated between application and cache containers.
  • Application or cache can be scaled separately depends on needs
  • More configuration possibilities (like ASYNC replication etc)
  • Minimizing affect of application to cache distribution and visa verse
  • Application containers restart keeps stored cache data

CONS:

  • Increase infrastructure complexity
  • Additional support and monitoring unit
  • Additional costs in case separate cache cloud nodes

Fortunately, with Wildfly Application Server it easy enough to switch between embedded and remote cache containers even in runtime (just another JNDI lookup). So, let's try it out! And first, we need to download stable infinispan server release. I have chosen 10.1.8 as my Wildfly 20 uses this one and potential compatibility issues should be excluded.

After download, please extract distribution archive and run infinispan server

kostenko@kostenko:/opt/infinispan-server-10.1.8.Final/bin$ ./server.sh

By default infinispan server will use port 11222 on 127.0.0.1. To bind another IP just use -b binding parameter like -b 0.0.0.0 on startup.

To create named cache you can use provided UI (http://127.0.0.1:11222/) or cli console like

/opt/iplatform/infinispan/bin/cli.sh
[disconnected]> connect
create cache --template=org.infinispan.REPL_ASYNC myremotecache

Now let's perform Wildfly configuration to use remote cache container

/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=ispn1:add(host=127.0.0.1, port=11222)
batch
/subsystem=infinispan/remote-cache-container=myRemoteContainer:add(default-remote-cluster=data-grid-cluster)
/subsystem=infinispan/remote-cache-container=myRemoteContainer/remote-cluster=data-grid-cluster:add(socket-bindings=[ispn1])
run-batch

Actually, we just have finished with environment configuration and now we are ready for application development. As usual, Jakarta EE build.gradle looks pretty laconical:

apply plugin: 'war'
dependencies {
    providedCompile "jakarta.platform:jakarta.jakartaee-api:8.0.0"
    providedCompile "org.infinispan:infinispan-core:10.1.8.Final"
    providedCompile "org.infinispan:infinispan-client-hotrod:10.1.8.Final"
}

To use configured cache container just inject registered @Resource:

@Named
public class TestCacheService {

    public static final String REMOTE_CACHE_NAME = "myremotecache";

    @Resource(lookup = "java:jboss/infinispan/remote-container/myRemoteContainer")
    org.infinispan.client.hotrod.RemoteCacheContainer remoteCacheContainer;

    public void putRemoteCache(String key, String value) {
        remoteCacheContainer.getCache(REMOTE_CACHE_NAME).put(key, String.format("%s (%s)", value, new Date()));
    }

    public Object getRemoteCache(String key) {
        return remoteCacheContainer.getCache(REMOTE_CACHE_NAME).get(key);
    }
}

Also, you can provide resource reference by WEB-INF/web.xml descriptor and use shorter resource lookup by name like @Resource(name = "myremotecontainer")

<resource-env-ref>
    <resource-env-ref-name>myremotecontainer</resource-env-ref-name>
    <lookup-name>java:jboss/infinispan/remote-container/myRemoteContainer</lookup-name>
</resource-env-ref>

Last thing we need, - is provide module dependencies by MANIFEST.MF:

Manifest-Version: 1.0
Dependencies: org.infinispan, org.infinispan.commons, org.infinispan.client.hotrod export

OR through jboss-deployment-structure.xml :

<jboss-deployment-structure>
   <deployment>
      <dependencies>
         <module name="org.infinispan" export="TRUE" />
         <module name="org.infinispan.commons" export="TRUE" />
         <module name="org.infinispan.client.hotrod" export="TRUE" />
      </dependencies>
   </deployment>
</jboss-deployment-structure>

This is it! Build, deploy, and test it out.

curl -o - "http://localhost:8080/jcache-examples/jcache/ispn-remote-put?key=KEY1&value=VALUE1"
ok
curl -o - "http://localhost:8080/jcache-examples/jcache/ispn-remote-get?key=KEY1"
VALUE1 (Sat Nov 28 20:48:51 EET 2020)

To check remote cache container statistics you can use UI or Infinispan CLI console:

[disconnected]> connect
cd caches
stats myremotecache
{
  "time_since_start" : 23866,
  "time_since_reset" : 23866,
  "current_number_of_entries" : 1,
  "current_number_of_entries_in_memory" : 1,
  "total_number_of_entries" : 1,
  "off_heap_memory_used" : 0,
  ...

Last point i would like to pay attention is cache container height availability with Infinispan clustering. By default, Infinispan uses MPING (multicast) protocol to cluster auto discovery. You can easy check it just by running another ISPN instances on some network. For example:

$ cd <ISPN_HOME>
$ cp -r server server2
$ bin/server.sh -o 100 -s server2

$ bin/cli.sh
connect
describe
{
  "version" : "10.1.8.Final",
  ...
  "cluster_members_physical_addresses" : [ "127.0.0.1:7800", "127.0.0.1:7801" ],
  "cluster_size" : 2,
  ...
}

Do not forget to add new ISPN node to your Wildfly configuration

/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=ispn2:add(host=127.0.0.1, port=11322)
/subsystem=infinispan/remote-cache-container=myRemoteContainer/remote-cluster=data-grid-cluster:write-attribute(name=socket-bindings, value=[ispn1,ispn2])

Please, notice if you perform cloud deployment or have some network restrictions, - auto discovery with MPING can be not accessible. In this case you can use a static list of IP addresses by providing TCPPING configuration via server/conf/infinispan.xml. Just add jgroups section and edit transport stack for default cache-container :

<infinispan>

 <jgroups>
    <stack name="mytcpping">
      <TCP bind_port="7800" port_range="30" recv_buf_size="20000000" send_buf_size="640000"/>
      <TCPPING   initial_hosts="${jgroups.tcpping.initial_hosts:127.0.0.1[7800],127.0.0.1[7800]}"/>
      <MERGE3 />
      <FD_SOCK />
      <FD_ALL timeout="3000" interval="1000" timeout_check_interval="1000" />
      <VERIFY_SUSPECT timeout="1000" />
      <pbcast.NAKACK2 use_mcast_xmit="false" xmit_interval="100" xmit_table_num_rows="50" xmit_table_msgs_per_row="1024" xmit_table_max_compaction_time="30000" />
      <UNICAST3 xmit_interval="100" xmit_table_num_rows="50" xmit_table_msgs_per_row="1024" xmit_table_max_compaction_time="30000" />
      <pbcast.STABLE stability_delay="200" desired_avg_gossip="2000" max_bytes="1M" />
      <pbcast.GMS print_local_addr="false" join_timeout="${jgroups.join_timeout:2000}" />
      <UFC max_credits="4m" min_threshold="0.40" />
      <MFC max_credits="4m" min_threshold="0.40" />
      <FRAG3 />
    </stack>
  </jgroups>

   <cache-container name="default" statistics="true">
     <transport stack="mytcpping" node-name="${infinispan.node.name:}"/>
   </cache-container>
...

For more details about configuration, please refer to WildFly 20 Infinispan Model Reference and Infinispan community documentation

Source code of described example available on GitHub


November 28, 2020 10:00 PM

Grab a Pocket Sky give-away! – The Two Minutes Tuesday 012

by Markus Karg at November 28, 2020 06:45 PM

Hey guys!

Be lucky and get one of two free Pocket Sky wearables donated by Active Wearables (https://www.pocket-sky.com/).

Time to sum up after one month of testing light-therapy-to-go. Does Pocket Sky work? Is there a risk? Is it worth the price? Get answers to the questions I had been asked by you.

While Active Wearables donated the two free give-aways, I bought my own Pocket Sky from my own money and did not get paid in any form for this episode. So be assured, the test result is my own, even if officially the video is marked as sponsored due to that.

I do not get paid for this show, nor do I receive free gadgets, and I am in no way afiliated to the vendor of “Pocket Sky”. I just want to help people suffering from these symptoms.

If you like my show, please subscribe to my channel, or become a patreon (https://www.patreon.com/mkarg).

CU!


by Markus Karg at November 28, 2020 06:45 PM

Deploy Friday E33 From Dev to Deploy with Helidon, the lightweight Java microservices framework

by otaviojava at November 27, 2020 02:23 PM

With cloud computing, several solutions were born to make the developer’s life easier and simpler to develop. With that, the question arises: How will Java deal with solutions like NodeJS? Let me introduce to you Oracle Helidon. Helidon was designed to be simple and fast and comprises two versions: Helidon SE and Helidon MP. Helidon […]

by otaviojava at November 27, 2020 02:23 PM

10 Strategies for Developing Reliable Jakarta EE Applications for the Cloud

by Fabio Turizo at November 27, 2020 09:00 AM

What happens when an application designed for a small user base needs to be scaled up and moved to the cloud?

It needs to live in a distributed environment: responding to an appropriate number of concurrent user requests per second and ensuring users find the application reliable. 

Though Jakarta EE and Eclipse MicroProfile can help with reliable clustering, there is no standard API in Jakarta EE that defines how clustering should work currently. This might change in the future, but in the meantime, this gap must be filled by DevOps engineers.

In this blog, we will cover 10 technical strategies to deal with clustering challenges when developing Jakarta EE and MicroProfile for cloud environments.


by Fabio Turizo at November 27, 2020 09:00 AM

ORA-01795 and JPA function workaround

November 26, 2020 10:00 PM

Few posts ago i wrote about Hibernate Interceptor to solve ORA-01795: maximum number of expressions in a list is 1000 error. This way can be very helpful in case you got this limitation, but by some reasons not able to perform refactoring.

Another way to get it done with JPQL is a JPA function(). We used similar approach to implement JPA paging with COUNT(*) OVER().

So, let's see how less code we need to get it work with custom Dialect workaround.

Custom dialect:

public class MyOraDialect extends Oracle10gDialect {
    public MyOraDialect () {
        super();
        // sql tuples workaround
        registerFunction( "safeTupleIn", new VarArgsSQLFunction( StandardBasicTypes.INTEGER, "(", ",0),(", ",0)"));
        // custom SQLFunction workaround
        registerFunction( "safeIn", new SafeInFunction());
    }
}

Usage example:

@Test
public void safeTupleIn1000Test() throws Exception {
     EntityManager em = Persistence.createEntityManagerFactory("myDSTestOra").createEntityManager();
     // this.generateTestData(em);
     ...
     Query query =  em.createQuery("SELECT b as post FROM OraBlogEntity b where (id, 0) in (function('safeTupleIn',:ids))", Tuple.class);
     query.setParameter("ids", idsList);
     List<Tuple> tpList = query.getResultList();
     System.out.println(tpList.size());
}

or bit cleaner:

...
Query query =  em.createQuery("SELECT b as post FROM OraBlogEntity b where id in (function('safeIn', id, :ids))", Tuple.class);
query.setParameter("ids", idsList);
...

Result SQL in this case SQL tuples will looks like

Hibernate: select orablogent0_.id as id1_0_, orablogent0_.body as body2_0_, orablogent0_.title as title3_0_ from orablogentity orablogent0_ where (orablogent0_.id , 0) in ((?,0),(?,0),(?....)

In case custom SQLFunction implementation:

Hibernate: select orablogent0_.id as id1_0_, orablogent0_.body as body2_0_, orablogent0_.title as title3_0_ from orablogentity orablogent0_ where orablogent0_.id in (?,...,?) or orablogent0_.id in (?,...,?)

Below is simple example how custom org.hibernate.dialect.function.SQLFunction can be implemented.

public class SafeInFunction implements SQLFunction {
    private final static int IN_CAUSE_LIMIT = 1000;
    ...
    @Override
    public String render(Type firstArgumentType, List arguments, SessionFactoryImplementor factory) throws QueryException {
        final StringBuilder buf = new StringBuilder();
        String fieldName = (String) arguments.get(0);
        for (int i = 1; i < arguments.size(); i++) {
            if (i % IN_CAUSE_LIMIT == 0) {
                buf.deleteCharAt(buf.length() - 1).append(") or ").append(fieldName).append(" in (");
            }
            buf.append("?,");
        }
        return buf.deleteCharAt(buf.length() - 1).toString();
    }
}

PS. Hibernate provides org.hibernate.dialect.Dialect method to overwrite

/**
 * Return the limit that the underlying database places on the number of elements in an {@code IN} predicate.
 * If the database defines no such limits, simply return zero or less-than-zero.
 *
 * @return int The limit, or zero-or-less to indicate no limit.
 */
public int getInExpressionCountLimit() {
  return 0;
}

But unfortunately did not provides properly implementation yet and just throw warning

WARN: HHH000443: Dialect limits the number of elements in an IN predicate to 1000 entries.  However, the given parameter list [ids] contained 1111 entries, which will likely cause failures to execute the query in the database

Source code of described example available on GitHub


November 26, 2020 10:00 PM

How to use CockroachDB with Hibernate

by Thorben Janssen at November 26, 2020 01:37 PM

The post How to use CockroachDB with Hibernate appeared first on Thorben Janssen.

Disclaimer: This post is sponsored by Cockroach Labs. CockroachDB is an open-source relational database designed to be highly scalable and reliable in distributed environments. It’s available on AWS and Google Cloud or as an on-premise installation. This makes it an interesting candidate for microservice-based applications. If you want to give it a try or if […]

The post How to use CockroachDB with Hibernate appeared first on Thorben Janssen.


by Thorben Janssen at November 26, 2020 01:37 PM

Architecting and delivering Java applications in the cloud era – Joker Conference, 2020

by otaviojava at November 26, 2020 12:21 PM

More about the talk delivered during the Joker Conference in 2020: Joker Conference Talk Details Slides Sample Source https://github.com/otaviojava/fruit-list-quarkus Business Automation Technologies KIE Community and its technologies:  jBPM – Open Source Business Automation Drools – Business Rules Management System (Java™, Open Source)  OptaPlanner – Constraint satisfaction solver (Java™, Open Source)  Kogito – Cloud Native Business […]

by otaviojava at November 26, 2020 12:21 PM

Jakarta EE 9 Hello World example application

by WildFly Admin (francesco@mastertheboss.com) at November 24, 2020 09:12 AM

In the last post we had our first taste of Jakarta EE 9 with the preview version of WildFly 22: How to run Jakarta EE 9 on WildFly . Let's see now how to build and deploy sample application which uses the 'jakarta' package namespace.


by WildFly Admin (francesco@mastertheboss.com) at November 24, 2020 09:12 AM

Back to the top