Skip to content

Commit ae2167e

Browse files
committed
Review fixes
1 parent 6547bfe commit ae2167e

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed
Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.temporal.samples.workerversioning;
22

3+
import com.fasterxml.jackson.annotation.JsonCreator;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
35
import io.temporal.activity.ActivityInterface;
46
import io.temporal.activity.ActivityMethod;
57

@@ -13,30 +15,24 @@ public interface Activities {
1315
String someIncompatibleActivity(IncompatibleActivityInput input);
1416

1517
class IncompatibleActivityInput {
16-
String calledBy;
17-
String moreData;
18+
private final String calledBy;
19+
private final String moreData;
1820

19-
public IncompatibleActivityInput() {}
20-
21-
public IncompatibleActivityInput(String calledBy, String moreData) {
21+
@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
22+
public IncompatibleActivityInput(
23+
@JsonProperty("calledBy") String calledBy, @JsonProperty("moreData") String moreData) {
2224
this.calledBy = calledBy;
2325
this.moreData = moreData;
2426
}
2527

28+
@JsonProperty("calledBy")
2629
public String getCalledBy() {
2730
return calledBy;
2831
}
2932

33+
@JsonProperty("moreData")
3034
public String getMoreData() {
3135
return moreData;
3236
}
33-
34-
public void setCalledBy(String calledBy) {
35-
this.calledBy = calledBy;
36-
}
37-
38-
public void setMoreData(String moreData) {
39-
this.moreData = moreData;
40-
}
4137
}
4238
}

core/src/main/java/io/temporal/samples/workerversioning/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ The sample creates multiple worker versions (1.0, 1.1, and 2.0) within one deplo
99

1010
## Steps to run this sample:
1111

12-
1) Run a [Temporal service](https://github.com/temporalio/samples-java/tree/main/#how-to-use).
12+
1) Run a [Temporal service](https://github.com/temporalio/samples-java/tree/main/#how-to-use). And
13+
ensure that you're using at least Server version 1.28.0 (CLI version 1.4.0).
1314

1415
2) Start the main application (this will guide you through the sample):
1516
```bash

0 commit comments

Comments
 (0)