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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.temporal.nexus.Nexus;
import io.temporal.nexus.WorkflowRunOperation;
import io.temporal.samples.nexus.service.SampleNexusService;
import java.util.Locale;

// To create a service implementation, annotate the class with @ServiceImpl and provide the
// interface that the service implements. The service implementation class should have methods that
Expand Down Expand Up @@ -55,13 +56,18 @@ public OperationHandler<SampleNexusService.HelloInput, SampleNexusService.HelloO
.newWorkflowStub(
HelloHandlerWorkflow.class,
// Workflow IDs should typically be business meaningful IDs and are used to
// dedupe workflow starts. For this example, we're using the request ID
// allocated by Temporal when the caller workflow schedules
// the operation, this ID is guaranteed to be stable across retries of this
// operation.
// dedupe workflow starts.
// For this example, tie the workflow ID to the customer being greeted so
Comment on lines +59 to +60
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor nit: The new comment doesn't have a line break between paragraphs, but does have one on line 62. So just adding a \n here to be consistent.

Suggested change
// dedupe workflow starts.
// For this example, tie the workflow ID to the customer being greeted so
// dedupe workflow starts.
//
// For this example, tie the workflow ID to the customer being greeted so

// that repeated operations for the same customer run on the same workflow.
//
// Task queue defaults to the task queue this operation is handled on.
WorkflowOptions.newBuilder().setWorkflowId(details.getRequestId()).build())
WorkflowOptions.newBuilder()
.setWorkflowId(
String.format(
"hello-%s-%s",
input.getName(),
input.getLanguage().name().toLowerCase(Locale.ROOT)))
.build())
::hello);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.temporal.nexus.WorkflowRunOperation;
import io.temporal.samples.nexus.handler.HelloHandlerWorkflow;
import io.temporal.samples.nexus.service.SampleNexusService;
import java.util.Locale;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
Expand Down Expand Up @@ -52,14 +53,18 @@ public OperationHandler<SampleNexusService.HelloInput, SampleNexusService.HelloO
HelloHandlerWorkflow.class,
// Workflow IDs should typically be business meaningful IDs and are used to
// dedupe workflow starts.
// For this example, we're using the request ID allocated by Temporal when
// the
// caller workflow schedules
// the operation, this ID is guaranteed to be stable across retries of this
// operation.
//
// For this example, tie the workflow ID to the customer being greeted so
// that repeated operations for the same customer run on the same workflow.
//
// Task queue defaults to the task queue this operation is handled on.
WorkflowOptions.newBuilder().setWorkflowId(details.getRequestId()).build())
WorkflowOptions.newBuilder()
.setWorkflowId(
String.format(
"hello-%s-%s",
input.getName(),
input.getLanguage().name().toLowerCase(Locale.ROOT)))
.build())
::hello);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.temporal.nexus.WorkflowHandle;
import io.temporal.nexus.WorkflowRunOperation;
import io.temporal.samples.nexus.service.SampleNexusService;
import java.util.Locale;

// To create a service implementation, annotate the class with @ServiceImpl and provide the
// interface that the service implements. The service implementation class should have methods that
Expand Down Expand Up @@ -39,19 +40,19 @@ public OperationHandler<SampleNexusService.HelloInput, SampleNexusService.HelloO
.newWorkflowStub(
HelloHandlerWorkflow.class,
// Workflow IDs should typically be business meaningful IDs and are used
// to
// dedupe workflow starts.
// For this example, we're using the request ID allocated by Temporal
// when
// the
// caller workflow schedules
// the operation, this ID is guaranteed to be stable across retries of
// this
// operation.
// to dedupe workflow starts.
//
// For this example, tie the workflow ID to the customer being greeted
// so that repeated operations for the same customer run on the same
// workflow.
//
// Task queue defaults to the task queue this operation is handled on.
WorkflowOptions.newBuilder()
.setWorkflowId(details.getRequestId())
.setWorkflowId(
String.format(
"hello-%s-%s",
input.getName(),
input.getLanguage().name().toLowerCase(Locale.ROOT)))
.build())
::hello,
input.getName(),
Expand Down
Loading