Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Minor fixes
  • Loading branch information
mfateev committed Jun 27, 2020
commit 047d3e955504c997844e23b39ea0e03bceb7194b
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import io.temporal.activity.ActivityOptions;
import io.temporal.common.RetryOptions;
import io.temporal.failure.ActivityFailure;
import io.temporal.workflow.ActivityStub;
import io.temporal.workflow.Saga;
import io.temporal.workflow.Workflow;
import java.time.Duration;
Expand All @@ -40,8 +39,6 @@ public class TripBookingWorkflowImpl implements TripBookingWorkflow {

@Override
public void bookTrip(String name) {
ActivityStub dynamic = Workflow.newUntypedActivityStub(null);
dynamic.execute("reserveCar", String.class, "bar");
// Configure SAGA to run compensation activities in parallel
Saga.Options sagaOptions = new Saga.Options.Builder().setParallelCompensation(true).build();
Saga saga = new Saga(sagaOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@
public interface StoreActivities {

final class TaskListFileNamePair {
private final String hostTaskList;
private final String fileName;
private String hostTaskList;
private String fileName;

public TaskListFileNamePair(String hostTaskList, String fileName) {
this.hostTaskList = hostTaskList;
this.fileName = fileName;
}

/** Jackson needs it */
public TaskListFileNamePair() {}

public String getHostTaskList() {
return hostTaskList;
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/io/temporal/samples/hello/HelloCron.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ public static void main(String[] args) throws InterruptedException {
.setWorkflowId(CRON_WORKFLOW_ID)
.setTaskList(TASK_LIST)
.setCronSchedule("* * * * *")
// Execution timeout limits total time. Cron will stop executing after this timeout.
.setWorkflowExecutionTimeout(Duration.ofMinutes(10))
// Run timeout limits duration of a single workflow invocation.
.setWorkflowRunTimeout(Duration.ofMinutes(1))
.build();
// WorkflowOptions.newBuilder().setCronSchedule("@every 2s").build();
GreetingWorkflow workflow = client.newWorkflowStub(GreetingWorkflow.class, workflowOptions);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/temporal/samples/hello/HelloSignal.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public List<String> getGreetings() {
@Override
public void waitForName(String name) {
messageQueue.add("Hello " + name + "!");
throw new IllegalStateException("simulated");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void withdraw(String accountId, String referenceId, int amountCents) {
System.out.printf(
"Withdraw to %s of %d cents requested. ReferenceId=%s\n",
accountId, amountCents, referenceId);
// throw new RuntimeException("simulated");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
public class AccountTransferWorkflowImpl implements AccountTransferWorkflow {

private final ActivityOptions options =
ActivityOptions.newBuilder()
.setStartToCloseTimeout(Duration.ofSeconds(5))
.setScheduleToStartTimeout(Duration.ofMinutes(10))
.build();
ActivityOptions.newBuilder().setStartToCloseTimeout(Duration.ofSeconds(5)).build();
private final Account account = Workflow.newActivityStub(Account.class, options);

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</encoder>
</appender>
<logger name="io.grpc.netty" level="INFO"/>
<root level="INFO">
<root level="WARN">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to reduce noise?

<appender-ref ref="STDOUT" />
</root>
</configuration>