Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
required: false
type: boolean
default: false
version_override:
description: 'Override computed version (e.g., 1.35.0-pkware.1). Leave empty for auto.'
required: false
type: string
default: false

permissions: {}

Expand All @@ -41,7 +46,7 @@ jobs:
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Build and test
working-directory: build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0
with:
distribution: 'temurin'
java-version: '21'
java-version: '25'

- name: Build and test
if: steps.detect.outputs.should_sync == 'true'
Expand Down
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,39 @@ Patch-based fork of [temporalio/sdk-java](https://github.com/temporalio/sdk-java

| Patch | Description |
|-------|-------------|
| 0001 | Replace Jackson with Moshi as default JSON converter |
| 0002 | Remove GSON dependency |
| 0003 | Replace grpc-netty-shaded with grpc-netty (real, un-shaded) |
| 0004 | Change groupId to `com.pkware.temporal` |
| 0001 | Replace Jackson with Micronaut Serde as default JSON converter (also bumps the build to JDK 25 / Gradle 9) |
| 0002 | Replace grpc-netty-shaded with grpc-netty (real, un-shaded) |
| 0003 | Change groupId to `com.pkware.temporal` |
| 0004 | Add Wire protobuf support |

## Serialization: Micronaut Serde

The default `json/plain` `PayloadConverter` is `io.temporal.common.converter.MicronautSerdePayloadConverter`,
backed by Micronaut Serde (Jackson 3 streaming + `jackson-annotations`, **no `jackson-databind`**). In
production, construct the data converter with your application's injected `io.micronaut.serde.ObjectMapper`:

```java
DataConverter converter =
DefaultDataConverter.newDefaultInstance()
.withPayloadConverterOverrides(new MicronautSerdePayloadConverter(appObjectMapper));
```

The no-arg constructor falls back to a library-private mapper (used by SDK defaults and tests).

**Behavior differences from the previous Jackson/Moshi converter** (Serde is reflection-free / compile-time):

- Workflow argument/result types must be `@io.micronaut.serde.annotation.Serdeable` (your Micronaut 5 models already are).
- **Public-field POJOs serialize to `{}`** — Serde uses getter/property access by default. Use records, getters, or `@Introspected(accessKind = {FIELD, METHOD})`.
- `java.time.Duration` serializes as integer nanoseconds (Serde default), not an ISO-8601 string.
- An empty `byte[]` field inside a large bean may deserialize as `null`.
- Wire `com.squareup.wire.Message` types serialize as native protobuf binary (`protobuf/wire`); the previous nested-Wire-in-JSON (Moshi `WireJsonAdapterFactory`) path is gone.

## Maven coordinates

```kotlin
// build.gradle.kts
implementation("com.pkware.temporal:temporal-sdk:1.35.0-pkware.1")
testImplementation("com.pkware.temporal:temporal-testing:1.35.0-pkware.1")
implementation("com.pkware.temporal:temporal-sdk:1.36.0-pkware.1")
testImplementation("com.pkware.temporal:temporal-testing:1.36.0-pkware.1")
```

## Version scheme
Expand Down Expand Up @@ -45,20 +67,20 @@ cd build
./gradlew test
```

Requires JDK 21.
Requires **JDK 25** (Micronaut Serde 3.x requires JVM 17+; the build targets `--release 25`). The Gradle wrapper is 9.x, which runs natively on JDK 25.

### Publishing locally

```bash
cd build
./gradlew publishToMavenLocal -PoverrideVersion=1.35.0-pkware.1
./gradlew publishToMavenLocal -PoverrideVersion=1.36.0-pkware.1
```

Then add `mavenLocal()` to your consuming project's repositories block.

## Dependency versions

New dependencies introduced by patches (e.g. Moshi) have their versions in `overlay/gradle.properties`. This file is copied into `build/` by `apply-patches.sh` and is scannable by Renovate.
New dependencies introduced by patches (Micronaut Serde, Wire) have their versions in `overlay/gradle.properties` (`micronautSerdeVersion`, `micronautVersion`, `wireVersion`), along with the Gradle heap settings the JDK-25 build needs. This file is copied into `build/` by `apply-patches.sh` and is scannable by Renovate. Versions bumped on existing dependencies (Mockito, logback, Error Prone) live in the patched `build.gradle` itself.

## Modifying patches

Expand Down
6 changes: 5 additions & 1 deletion overlay/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
moshiVersion=1.15.2
wireVersion=6.4.0
micronautSerdeVersion=3.0.0
micronautVersion=5.0.0
# JDK 25 + Gradle 9 + Micronaut Serde codegen need more heap than Gradle's 512MB default;
# the full parallel test suite OOMs otherwise.
org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=768m
Loading