Repository navigation
Conversation
pjfanning
marked this pull request as draft
April 25, 2026 12:20
pjfanning
added a commit
to pjfanning/incubator-pekko-samples
that referenced
this pull request
Oct 4, 2026
Motivation: Pekko 2.0.0-M4 is the latest core milestone and removes APIs the samples still used. Modification: - Bump Pekko core to 2.0.0-M4 and Pekko gRPC to 2.0.0-M2 (other modules stay on their latest 2.0.0-M1). - Replace removed OverflowStrategy.dropNew with dropTail in the cluster client gRPC samples (Java and Scala). - Replace removed Http().bindAndHandle/bindAndHandleAsync with newServerAt(...).bind(...). - Align ScalaPB compilerplugin with pekko-grpc 2.0.0-M2 (1.0.0-alpha.5). - Set evictionErrorLevel to Info where mixed milestones trip semver checks. - Set scalaVersion at ThisBuild in grpc-kubernetes so subprojects do not fall back to Scala 2.12. Result: All sbt and Maven samples compile against Pekko 2.0.0-M4. Tests: - sbt Test/compile (+ MultiJvm/compile) and mvn test-compile: pass for all samples - sharding-scala sbt test: pass; kafka-to-sharding-scala sbt test: pass - cluster-client-grpc-java mvn test: fails without --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED (Agrona 2.x), passes with it - cluster-client-grpc-scala multi-jvm:test: fails with the same Agrona error References: Refs apache#151
pjfanning
added a commit
to pjfanning/incubator-pekko-samples
that referenced
this pull request
Oct 4, 2026
Motivation: Pekko 2's pekko-remote depends on Agrona 2.x, which Artery uses for its buffer pools. Agrona needs access to jdk.internal.misc.Unsafe, so any node that starts remoting fails on JDK 17 with an IllegalAccessError. Modification: Pass --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED, only in samples that use pekko-remote/cluster, through every launch path: - .jvmopts for in-process sbt tests and non-forked sbt run - run/javaOptions for forked runs and MultiJvm/jvmOptions for multi-jvm - javaOptions for the forked kafka-to-sharding processor - argLine property for Maven surefire and .mvn/jvm.config for exec:java - start script / entrypoint of the Docker images Docker base images move from Java 11 to eclipse-temurin:17, since Pekko 2 requires Java 17. Result: Remote/cluster samples start and their tests pass on JDK 17. Tests: - sbt multi-jvm:test: cluster-java, cluster-scala, cluster-client-grpc-scala, distributed-data-java, distributed-data-scala - pass - sbt test: distributed-workers-scala, persistence-dc-scala, sharding-java, sharding-scala, kafka-to-sharding-scala, cluster-kubernetes-scala - pass - mvn test: cluster-java, cluster-client-grpc-java, persistence-dc-java, sharding-java - pass; cluster-kubernetes-java mvn test-compile - pass - sbt stage for both docker-compose samples: start script contains the flag - Docker-compose and minikube jobs: Not run References: Refs apache#151
pjfanning
added a commit
to pjfanning/incubator-pekko-samples
that referenced
this pull request
Oct 4, 2026
Motivation:
The cluster-kubernetes-java pods failed at startup with Pekko's
mixed-version check: Maven's nearest-wins resolution picked pekko-pki
2.0.0-M1 from pekko-http/pekko-management while core is 2.0.0-M4.
Modification:
Add an explicit pekko-pki dependency at ${pekko.version}.
Result:
All core Pekko modules resolve to 2.0.0-M4 and the app starts.
Tests:
- Checked resolved core Pekko artifacts for every sample (sbt export
fullClasspath / mvn dependency:list): only this sample was affected;
sbt picks the highest version so sbt builds already got pekko-pki M4
- Ran DemoApp locally: no mixed-version error, reaches Cluster Bootstrap
- minikube job: Not run locally
References:
Refs apache#151
pjfanning
added a commit
to pjfanning/incubator-pekko-samples
that referenced
this pull request
Oct 4, 2026
Motivation: With CI on JDK 17, `sbt paradox` in docs-gen fails: parboiled (used by Paradox's markdown reader) reflectively calls ClassLoader.findLoadedClass, which JDK 17 blocks without an add-opens. Modification: Add docs-gen/.jvmopts with --add-opens=java.base/java.lang=ALL-UNNAMED. pekko-sbt-paradox 1.0.1 is already the latest release. Result: docs-gen builds on JDK 17. Tests: - docs-gen sbt paradox on JDK 17: fails without the file, passes with it References: Refs apache#151
pjfanning
added a commit
to pjfanning/incubator-pekko-samples
that referenced
this pull request
Oct 4, 2026
Motivation: pekko-sbt-paradox 1.0.1 brings in sbt-paradox 0.9.2, whose parboiled version does not work on JDK 17. The previous commit worked around this with an add-opens in docs-gen/.jvmopts. Modification: - Declare sbt-paradox and sbt-paradox-theme 0.11.1 explicitly in docs-gen/project/plugins.sbt, as the pekko build does. - Remove docs-gen/.jvmopts. - Add docs-gen/.sbtopts with -J-Xmx2G: the newer plugins' ClassGraph scan across the 15 doc subprojects runs out of the default heap. Result: docs-gen builds on JDK 17 without opening java.lang. Tests: - docs-gen sbt paradox on JDK 17: pass, 15 sample sites generated (OutOfMemoryError without the heap setting) References: Refs apache#151
pjfanning
added a commit
to pjfanning/incubator-pekko-samples
that referenced
this pull request
Oct 4, 2026
Motivation: sbt warns that the `key in Scope` notation is deprecated. Modification: Convert the remaining `in` scoping in the docker-compose and cluster-kubernetes-scala builds to slash syntax. Result: No deprecated `in` scoping left in the sample builds. Tests: - docker-compose-java: show Docker/version, Docker/dockerExposedPorts, Docker/dockerEntrypoint - unchanged values - cluster-kubernetes-scala: show Compile/run/mainClass - unchanged References: Refs apache#151
Member
|
@pjfanning This need update too |
Motivation: Pekko 2.0.0-M4 is the latest core milestone and removes APIs the samples still used. Modification: - Bump Pekko core to 2.0.0-M4 and Pekko gRPC to 2.0.0-M2 (other modules stay on their latest 2.0.0-M1). - Replace removed OverflowStrategy.dropNew with dropTail in the cluster client gRPC samples (Java and Scala). - Replace removed Http().bindAndHandle/bindAndHandleAsync with newServerAt(...).bind(...). - Align ScalaPB compilerplugin with pekko-grpc 2.0.0-M2 (1.0.0-alpha.5). - Set evictionErrorLevel to Info where mixed milestones trip semver checks. - Set scalaVersion at ThisBuild in grpc-kubernetes so subprojects do not fall back to Scala 2.12. Result: All sbt and Maven samples compile against Pekko 2.0.0-M4. Tests: - sbt Test/compile (+ MultiJvm/compile) and mvn test-compile: pass for all samples - sharding-scala sbt test: pass; kafka-to-sharding-scala sbt test: pass - cluster-client-grpc-java mvn test: fails without --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED (Agrona 2.x), passes with it - cluster-client-grpc-scala multi-jvm:test: fails with the same Agrona error References: Refs apache#151
Motivation: Pekko 2's pekko-remote depends on Agrona 2.x, which Artery uses for its buffer pools. Agrona needs access to jdk.internal.misc.Unsafe, so any node that starts remoting fails on JDK 17 with an IllegalAccessError. Modification: Pass --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED, only in samples that use pekko-remote/cluster, through every launch path: - .jvmopts for in-process sbt tests and non-forked sbt run - run/javaOptions for forked runs and MultiJvm/jvmOptions for multi-jvm - javaOptions for the forked kafka-to-sharding processor - argLine property for Maven surefire and .mvn/jvm.config for exec:java - start script / entrypoint of the Docker images Docker base images move from Java 11 to eclipse-temurin:17, since Pekko 2 requires Java 17. Result: Remote/cluster samples start and their tests pass on JDK 17. Tests: - sbt multi-jvm:test: cluster-java, cluster-scala, cluster-client-grpc-scala, distributed-data-java, distributed-data-scala - pass - sbt test: distributed-workers-scala, persistence-dc-scala, sharding-java, sharding-scala, kafka-to-sharding-scala, cluster-kubernetes-scala - pass - mvn test: cluster-java, cluster-client-grpc-java, persistence-dc-java, sharding-java - pass; cluster-kubernetes-java mvn test-compile - pass - sbt stage for both docker-compose samples: start script contains the flag - Docker-compose and minikube jobs: Not run References: Refs apache#151
Motivation:
The cluster-kubernetes-java pods failed at startup with Pekko's
mixed-version check: Maven's nearest-wins resolution picked pekko-pki
2.0.0-M1 from pekko-http/pekko-management while core is 2.0.0-M4.
Modification:
Add an explicit pekko-pki dependency at ${pekko.version}.
Result:
All core Pekko modules resolve to 2.0.0-M4 and the app starts.
Tests:
- Checked resolved core Pekko artifacts for every sample (sbt export
fullClasspath / mvn dependency:list): only this sample was affected;
sbt picks the highest version so sbt builds already got pekko-pki M4
- Ran DemoApp locally: no mixed-version error, reaches Cluster Bootstrap
- minikube job: Not run locally
References:
Refs apache#151
Motivation: With CI on JDK 17, `sbt paradox` in docs-gen fails: parboiled (used by Paradox's markdown reader) reflectively calls ClassLoader.findLoadedClass, which JDK 17 blocks without an add-opens. Modification: Add docs-gen/.jvmopts with --add-opens=java.base/java.lang=ALL-UNNAMED. pekko-sbt-paradox 1.0.1 is already the latest release. Result: docs-gen builds on JDK 17. Tests: - docs-gen sbt paradox on JDK 17: fails without the file, passes with it References: Refs apache#151
Motivation: pekko-sbt-paradox 1.0.1 brings in sbt-paradox 0.9.2, whose parboiled version does not work on JDK 17. The previous commit worked around this with an add-opens in docs-gen/.jvmopts. Modification: - Declare sbt-paradox and sbt-paradox-theme 0.11.1 explicitly in docs-gen/project/plugins.sbt, as the pekko build does. - Remove docs-gen/.jvmopts. - Add docs-gen/.sbtopts with -J-Xmx2G: the newer plugins' ClassGraph scan across the 15 doc subprojects runs out of the default heap. Result: docs-gen builds on JDK 17 without opening java.lang. Tests: - docs-gen sbt paradox on JDK 17: pass, 15 sample sites generated (OutOfMemoryError without the heap setting) References: Refs apache#151
Motivation: Pekko 2.0.0 is staged on repository.apache.org for its release vote. Modification: Bump Pekko 2.0.0-M4 to 2.0.0 and pekko-http 2.0.0-M1 to 2.0.0-M2 in all sbt and Maven builds. Add the Apache staging repository as a resolver in every sbt build and Maven pom. Bump sbt to 1.12.15. Result: Samples build against the staged Pekko 2.0.0 artifacts. Tests: - Not run locally - relying on CI References: Refs apache#151
Motivation: With Pekko 2 the minimum versions are Scala 2.13 and Java 17, so the samples can drop compatibility idioms and use newer language features. Modification: - Bump Scala 3.3.7 to 3.3.9 and sbt 1.12.15 to 1.13.1. - Replace scala.collection.JavaConverters with scala.jdk.CollectionConverters. - Use instanceof pattern matching instead of instanceof plus cast. - Use Stream.toList() instead of collect(Collectors.toList()). - Use List.of/Set.of/Set.copyOf/Map.copyOf instead of Arrays.asList and Collections wrappers. - Use a switch expression for WeatherStation queries. - Remove imports that became unused. Result: Samples show idiomatic Scala 2.13+/Java 17 code. Tests: - Not run locally - relying on CI References: Refs apache#151
Motivation: CI failed in cluster-client-grpc-java: the poms still compiled with -source 1.8, which rejects the Java 17 pattern matching now used. Modification: Replace source/target 1.8 with release 17 in every Maven pom (maven.compiler.release in cluster-kubernetes-java). Result: Maven samples compile with Java 17 language features, matching Pekko 2's minimum. Tests: - mvn test-compile: pass for all 8 Maven samples References: Refs apache#151
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Pekko 2.0.0 is staged on repository.apache.org for its release vote. These
samples should build and run against it. Pekko 2 requires Java 17 and Scala
2.13+, so the samples can also drop older compatibility idioms.
Modification
Versions and build
Pekko gRPC 2.0.0-M2 and Pekko Management / Connectors Kafka 2.0.0-M1 are
unchanged.
(
Resolver.ApacheMavenStagingRepo) and Maven pom.<release>17</release>instead of source/target 1.8.evictionErrorLevel := Level.Infowhere mixed milestones trip semver checks.pekko-pkiin cluster-kubernetes-java. Maven's nearest-wins resolutionotherwise pulls an older version and fails Pekko's mixed-version check.
Runtime
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMEDto samples thatuse pekko-remote/cluster. Agrona 2.x, used by Artery, needs it. The flag is
set on every launch path:
.jvmopts,run/javaOptions,MultiJvm/jvmOptions, surefireargLine,.mvn/jvm.configand the Dockerentrypoints.
API changes from Pekko 2
OverflowStrategy.dropNewbecomesdropTail(cluster-client-grpc Java andScala).
Http().bindAndHandle*becomesHttp().newServerAt(...).bind(...).Code modernization
scala.collection.JavaConvertersbecomesscala.jdk.CollectionConverters.instanceofpattern matching instead ofinstanceoffollowed by a cast.Stream.toList()instead ofcollect(Collectors.toList()).List.of/Set.of/Set.copyOf/Map.copyOfinstead ofArrays.asListand the
Collections.*wrappers.WeatherStationqueries.Result
All samples build against Pekko 2.0.0 on JDK 17 and use idiomatic Scala
2.13+/Java 17 code.
Tests
sbt Test/compile(plusMultiJvm/compile) andmvn test-compile, and thesbt multi-jvm and Maven tests passed with the add-opens flag.
mvn test-compilepasses for all 8 Maven samples with Pekko 2.0.0 and theJava 17 changes.
not built locally for the sbt samples. This PR relies on CI for them.
References
None - tracks the Pekko 2.0.0 release candidate.