Can we start with making Pulsar is able to run with both Java 8 and Java
11?

Because I think there are still a lot of users running with Java 8.

- Sijie

On Mon, Feb 8, 2021 at 2:32 AM Enrico Olivelli <eolive...@gmail.com> wrote:

> Hello Pulsar community,
> I would like to start a discussion about Java 11 support and about dropping
> support for JDK8 on the server side.
> It will take time, see my points below.
>
> At the moment we have these use cases about Java compatibility:
> - Java client users
> - Building Pulsar and running Pulsar tests
> - Server users that use the binary tarball
> - Apache Pulsar Docker images consumers
>
> I have been running in production BookKeeper and Pulsar on modern JDKs
> (Java version > 8) for much time and I see that there are no issues at
> least for the scenarios I have seen.
>
> JDK11 is currently referred to as LTS by major vendors (for whatever it
> means, please do not enter a "Java LTS thread", there are plenty of threads
> about what is Java LTS about) and Java 17 is coming.
> I expect that any of the new users will start running on JDK11 (and
> probably on JDK15 for the early adopters) if they do not want to pay for
> JDK8 support
>
> Also the latest versions of Presto require Java 11 to run, if we do not
> move to Java 11 we won't be able to upgrade Presto.
>
> This is what I expect on the mid term (after 2.8):
>
> 1) Java Clients: stick to JDK8 compatibility
> I believe that on the Java client side we should stick to JDK8
> compatibility, because unfortunately JDK8 is still a version that is widely
> used in the industry.
> In order to ensure JDK8 compatibility we have useful tools:
> - there are Maven plugin that ensure that we are not producing and
> consuming third party libraries that are not compatible with JDK8
> - we can add one (or more) Maven modules that run on CI using JDK8 and
> consume the artifacts produced by the build
>
> 2) Building Pulsar and running Tests
> We can require Pulsar to be built on JDK11.
> We can set maven.compiler.release to 11 in generale and
> maven.compiler.release to 8 for all of the modules that concur to build up
> the Java client
> Tests will run on JDK11 on CI.
> We could desire to run the Pulsar client tests on JDK8, but many of them
> are indeed inside the pulsar-broker module.
>
> 3) Server users that use the binary tarball
> We will have to announce that from Pulsar 2.x (2.8 or 2.9?) Pulsar server
> side components will require JDK11
> The same applies to users that run Pulsar broker by starting it from the
> Jars deployed to Maven central.
>
> 4) Docker images consumers:
> This is easy, just change the images in order to use JDK11.
>
>
> I believe that enforcing JDK11 on the server side side is a big move and we
> should announce it with care and let users prepare for this jump.
>
> So in the meantime we could start with a soft transition plan, starting for
> 2.8 release:
> - Build Pulsar on JDK11 and run CI on JDK11
> - Set maven.compiler.release to JDK8
> - Change docker images to JDK11
>
> This way:
> - consumers of the Java client will be able to run on JDK8
> - consumers of the Binary tarballs for the server will be able to run on
> JDK8, say for Pulsar 2.8
> - consumers of Docker images will start to enjoy JDK11
> - Pulsar developers will get used to having JDK11, but they won't be able
> to leverage JDK11 language and JRE features (only faster runtime, GC....)
>
> I can start a PIP, but I believe a little discussion on the ML is a good
> starting point.
>
> Thoughts ?
> Enrico
>

Reply via email to