Skip to content

Upgrade to Pulsar 4.0.7 and version 8.0.0 - #191

Closed
heesung-sohn wants to merge 15 commits into
masterfrom
upgrade-pulsar-4.0.7-jdk21
Closed

heesung-sohn wants to merge 15 commits into
masterfrom
upgrade-pulsar-4.0.7-jdk21

Conversation

@heesung-sohn

Copy link
Copy Markdown
Collaborator

Summary

This PR upgrades the project to Pulsar 4.0.7 with JDK 21 and updates the version to 8.0.0 for the release.

Changes

  • Version: 7.0.16-SNAPSHOT → 8.0.0
  • JDK: 11 → 21
  • Pulsar: 3.2.3 → 4.0.7 (latest with Luna Streaming Docker support)

Dependency Updates (aligned with Pulsar 4.0.7)

  • Netty: 4.1.125.Final → 4.1.127.Final
  • Jackson: 2.15.3 → 2.17.2
  • SLF4J: 1.7.36 → 2.0.13
  • Lombok: 1.18.30 → 1.18.42
  • Curator: 5.1.0 → 5.7.1
  • Mockito: 1.10.19 → 5.19.0
  • Commons Compress: 1.26.0 → 1.27.1
  • Awaitility: 4.0.3 → 4.2.0
  • Testcontainers: 1.18.3 → 1.20.4
  • JUnit: 5.7.1 → 5.11.4
  • Maven Surefire: 3.1.0 → 3.5.2
  • Maven Compiler: 3.12.1 → 3.13.0

Infrastructure Updates

  • All GitHub Actions workflows updated to JDK 21
  • GitHub Actions versions updated (checkout v2→v4, setup-java v2→v4, cache v3→v4)
  • Test container image: datastax/lunastreaming:3.1_3.1 → 4.0.7_2

Testing

All dependencies are aligned with Pulsar 4.0.7's BOM for maximum compatibility.

- Upgrade Java version from 11 to 21
- Upgrade Pulsar from 4.0.8 to 4.0.7 (latest with Luna Streaming Docker image)
- Update all dependencies to match Pulsar 4.0.7 BOM:
  - Netty: 4.1.125.Final → 4.1.127.Final
  - Jackson: 2.15.3 → 2.17.2
  - SLF4J: 1.7.36 → 2.0.13
  - Lombok: 1.18.30 → 1.18.42
  - Curator: 5.1.0 → 5.7.1
  - Mockito: 1.10.19 → 5.19.0
  - Commons Compress: 1.26.0 → 1.27.1
  - Awaitility: 4.0.3 → 4.2.0
  - Testcontainers: 1.18.3 → 1.20.4
  - JUnit: 5.7.1 → 5.11.4
  - Maven Surefire: 3.1.0 → 3.5.2
  - Maven Compiler: 3.12.1 → 3.13.0
- Update all GitHub Actions workflows to use JDK 21
- Update GitHub Actions versions (checkout v2→v4, setup-java v2→v4, cache v3→v4)
- Update test container image: datastax/lunastreaming:3.1_3.1 → 4.0.7_2
- Update maven-shade-plugin to 3.6.0 for JDK 21 compatibility
- Replace PositionImpl with PositionFactory.create() for Pulsar 4.0.7 API
- Create ReflectionUtils utility to replace Mockito Whitebox (removed in 5.x)
- Replace Mockito Matchers with ArgumentMatchers (deprecated API removed)
- Replace getArgumentAt() with getArgument() in Mockito invocations
- Update test files to use new Mockito 5.x APIs

All modules now compile successfully with JDK 21 and Pulsar 4.0.7
The Security Manager was deprecated in JDK 17 and throws UnsupportedOperationException in JDK 21.
Removed -Djava.security.manager and -Djava.security.policy flags from TCK test execution configuration.

This fixes the TCK test failures in CI:
- java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release

Files updated:
- tck-executor/ts.jte
- tck-executor/ts.serverSideFilters.jte
The JavaTest harness calls System.setSecurityManager() internally, which throws
UnsupportedOperationException in JDK 21. Adding -Djava.security.manager=allow
permits the deprecated Security Manager to be used by the TCK framework.

This is the correct fix for JDK 21 compatibility with the Jakarta Messaging TCK.
Previously, 3 separate workflows were building the same code independently:
- Build and test
- TCK client-side filters
- TCK server-side filters

New optimized workflow:
1. Build once and upload artifacts
2. Run tests, TCK client-side, and TCK server-side in parallel using shared build
3. Saves ~66% build time by eliminating redundant builds

Benefits:
- Faster CI execution
- Lower resource usage
- Cleaner workflow management
- All jobs still run in parallel after build completes
- Changed -Djava.security.manager=allow to =disallow in TCK configs to prevent JavaTest from attempting to install deprecated Security Manager
- Consolidated CI workflows: removed artifact sharing complexity, simplified to independent builds with Maven caching
- Each job now builds independently but benefits from Maven repository caching for faster execution
The -Djava.security.manager=disallow flag needs to be set for both:
1. The JavaTest harness JVM (via ANT_OPTS)
2. The test execution JVM (already set in ts.jte files)

This prevents JavaTest from attempting to install the deprecated Security Manager.
Use both ANT_OPTS and JAVA_TOOL_OPTIONS to ensure the -Djava.security.manager=disallow flag is applied to all JVMs:
- ANT_OPTS: For Ant process
- JAVA_TOOL_OPTIONS: Universal JVM flag that applies to all Java processes including JavaTest harness
JDK 21's deprecated Security Manager causes JavaTest to fail when attempting to install it.
JDK 17 LTS is fully supported and doesn't have this issue.

Changes:
- Maven compiler source/target/release: 21 -> 17
- CI workflow: JDK 21 -> 17
- Removed Security Manager workaround flags from TCK configs
- All dependencies remain compatible with JDK 17
Reverted all JDK upgrade changes to keep the project stable:
- Maven compiler: JDK 17 -> JDK 11 (original)
- CI workflow: JDK 17 -> JDK 11 (original)
- TCK configs: Restored original Security Manager settings

Keeping only the core updates:
- Pulsar 4.0.7 upgrade
- 12 dependency updates aligned with Pulsar 4.0.7 BOM
- Pulsar API migration (PositionImpl -> PositionFactory)
- Mockito 5.x migration
- pom.xml: Added java.version=1.8 and java.release.version=8 for compatibility
- pom.xml: Keep maven.compiler.source/target/release=11 for Java 11 bytecode
- CI workflow: Use JDK 17 for building and testing
- This configuration maintains backward compatibility while using modern JDK
Align release workflow with CI workflow to use JDK 17 for building release artifacts.
@heesung-sohn heesung-sohn changed the title Upgrade to Pulsar 4.0.7, JDK 21, and version 8.0.0 Upgrade to Pulsar 4.0.7 and version 8.0.0 Jan 27, 2026
@heesung-sohn

Copy link
Copy Markdown
Collaborator Author

continuing the work by #192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant