Skip to content

Commit 22793af

Browse files
authored
Update readme and SslEnabledWorker code (temporalio#324)
* Update readme and SslEnabledWorker code Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io> * fixed formatting Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
1 parent dfcb4c6 commit 22793af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ All tests are available under [src/test/java](https://github.com/temporalio/samp
151151

152152
- [**Per Activity Type Options**](https://github.com/temporalio/samples-java/tree/master/src/main/java/io/temporal/samples/peractivityoptions): Demonstrates how to set per Activity type options.
153153

154+
- [**Configure WorkflowClient to use mTLS**](https://github.com/temporalio/samples-java/tree/master/src/main/java/io/temporal/samples/ssl): Demonstrates how to configure WorkflowClient when using mTLS.
155+
154156
### SDK Metrics
155157

156158
- [**Set up SDK metrics**](https://github.com/temporalio/samples-java/tree/master/src/main/java/io/temporal/samples/metrics): Demonstrates how to set up and scrape SDK metrics.

src/main/java/io/temporal/samples/ssl/SslEnabledWorker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.temporal.serviceclient.SimpleSslContextBuilder;
2525
import io.temporal.serviceclient.WorkflowServiceStubs;
2626
import io.temporal.serviceclient.WorkflowServiceStubsOptions;
27+
import io.temporal.worker.Worker;
2728
import io.temporal.worker.WorkerFactory;
2829
import java.io.FileInputStream;
2930
import java.io.InputStream;
@@ -49,7 +50,7 @@ public static void main(String[] args) throws Exception {
4950
String namespace = System.getenv("TEMPORAL_NAMESPACE");
5051
// Create SSL enabled client by passing SslContext, created by SimpleSslContextBuilder.
5152
WorkflowServiceStubs service =
52-
WorkflowServiceStubs.newInstance(
53+
WorkflowServiceStubs.newServiceStubs(
5354
WorkflowServiceStubsOptions.newBuilder()
5455
.setSslContext(SimpleSslContextBuilder.forPKCS8(clientCert, clientKey).build())
5556
.setTarget(targetEndpoint)
@@ -64,7 +65,7 @@ public static void main(String[] args) throws Exception {
6465
// worker factory that can be used to create workers for specific task queues
6566
WorkerFactory factory = WorkerFactory.newInstance(client);
6667
// Worker that listens on a task queue and hosts both workflow and activity implementations.
67-
// Worker worker = factory.newWorker(TASK_QUEUE);
68+
Worker worker = factory.newWorker(TASK_QUEUE);
6869
// TODO now register your workflow types and activity implementations.
6970
// worker.registerWorkflowImplementationTypes(...);
7071
// worker.registerActivitiesImplementations(...);

0 commit comments

Comments
 (0)