Skip to content

Commit

Permalink
Add upsert memo support for Java
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinn-With-Two-Ns committed Oct 28, 2024
1 parent dc7885b commit 3d17acb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language java --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language java --version 1.24.2 --tag-as-latest
run: ./temporal-omes build-worker-image --language java --version 1.26.1 --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:java-1.24.2 --scenario workflow_with_single_noop_activity --log-level debug --language java --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
run: docker run --rm --detach -i -p 10233:10233 omes:java-1.26.1 --scenario workflow_with_single_noop_activity --log-level debug --language java --run-id {{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes run-scenario --scenario workflow_with_single_noop_activity --log-level debug --server-address 127.0.0.1:10233 --run-id {{ github.run_id }} --connect-timeout 1m --iterations 5

Expand Down Expand Up @@ -194,6 +194,6 @@ jobs:
as-latest: true
go-version: 'v1.28.1'
ts-version: 'v1.10.2'
java-version: 'v1.24.2'
java-version: 'v1.26.0'
py-version: 'v1.6.0'
dotnet-version: 'v1.2.0'
2 changes: 1 addition & 1 deletion workers/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.8.9'
implementation 'com.jayway.jsonpath:json-path:2.6.0'
implementation 'info.picocli:picocli:4.6.2'
implementation 'io.temporal:temporal-sdk:1.24.2'
implementation 'io.temporal:temporal-sdk:1.26.1'
implementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
implementation 'org.reflections:reflections:0.10.2'
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
Expand Down
8 changes: 6 additions & 2 deletions workers/java/io/temporal/omes/KitchenSinkWorkflowImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
import io.temporal.workflow.*;
import java.time.Duration;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import org.slf4j.Logger;

Expand Down Expand Up @@ -190,8 +192,10 @@ private Payload handleAction(KitchenSink.Action action) {
handleAction(patchMarker.getInnerAction());
}
} else if (action.hasUpsertMemo()) {
// TODO(https://github.com/temporalio/sdk-java/issues/623) Java does not support upsert memo.
log.debug("Java does not support upsert memo");
KitchenSink.UpsertMemoAction upsertMemoAction = action.getUpsertMemo();
Map<String, Object> memo = new HashMap();
upsertMemoAction.getUpsertedMemo().getFieldsMap().forEach(memo::put);
Workflow.upsertMemo(memo);
} else {
throw Workflow.wrap(new IllegalArgumentException("Unrecognized action type"));
}
Expand Down

0 comments on commit 3d17acb

Please sign in to comment.