Skip to content

Commit f107c79

Browse files
authored
add config to run spring boot samples connecting to Temporal Cloud (temporalio#505)
* add config to connect to temporal cloud * add config to connect to temporal cloud
1 parent 5a44080 commit f107c79

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,15 @@ More info on each sample:
144144
- [**Synchronous Update**](/springboot/src/main/java/io/temporal/samples/springboot/update): Learn how to use Synchronous Update feature with this purchase sample
145145
- [**Kafka Request / Reply**](/springboot/src/main/java/io/temporal/samples/springboot/kafka): Sample showing possible integration with event streaming platforms such as Kafka
146146
- [**Customize Options**](/springboot/src/main/java/io/temporal/samples/springboot/customize): Sample showing how to customize options such as WorkerOptions, WorkerFactoryOptions, etc (see options config [here](springboot/src/main/java/io/temporal/samples/springboot/customize/TemporalOptionsConfig.java))
147-
147+
148+
149+
#### Temporal Cloud
150+
To run any of the SpringBoot samples in your Temporal Cloud namespace:
151+
152+
1. Edit the [application-tc.yaml](/springboot/src/main/resources/application-tc.yaml) to set your namespace and client certificates.
153+
154+
2. Start SpringBoot from main repo dir with the `tc` profile:
155+
156+
./gradlew bootRun --args='--spring.profiles.active=tc'
157+
158+
3. Follow the previous section from step 2
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
spring.temporal:
2+
namespace: <namespace_id> # https://docs.temporal.io/cloud/#temporal-cloud-namespace-id
3+
connection:
4+
target: <namespace_id>.tmprl.cloud:7233
5+
mtls:
6+
key-file: /path/to/key.key
7+
cert-chain-file: /path/to/cert.pem
8+
9+
# more configuration options https://github.com/temporalio/sdk-java/tree/master/temporal-spring-boot-autoconfigure-alpha#mtls

springboot/src/main/resources/application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ spring:
77
name: temporal-samples
88
# temporal specific configs
99
temporal:
10+
namespace: default
1011
connection:
1112
target: 127.0.0.1:7233
12-
target.namespace: default
1313
# (Note following configuration are not set by default but serve more as reference)
1414
# workers:
1515
# - task-queue: DemoTaskQueue

0 commit comments

Comments
 (0)