Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upsert memo support for Java #118

Merged
merged 1 commit into from
Oct 28, 2024
Merged
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
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 @@ -203,6 +203,6 @@ jobs:
as-latest: true
go-version: 'v1.29.0'
ts-version: 'v1.10.2'
java-version: 'v1.24.2'
java-version: 'v1.26.0'
py-version: 'v1.7.0'
dotnet-version: 'v1.3.1'
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
Loading