Skip to content

Commit 2b9d8eb

Browse files
committed
fix
1 parent 02f92ea commit 2b9d8eb

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

samples/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ plugins {
77
group 'io.durabletask'
88
version = '0.1.0'
99
def grpcVersion = '1.59.0'
10+
def durabletaskClientVersion = '1.5.0'
1011
archivesBaseName = 'durabletask-samples'
1112

1213
application {
1314
mainClass = 'io.durabletask.samples.WebAppToDurableTaskSchedulerSample'
1415
}
1516

1617
dependencies {
17-
implementation project(':client')
1818
implementation project(':azuremanaged:client')
1919
implementation project(':azuremanaged:worker')
2020

21+
implementation "com.microsoft:durabletask-client:${durabletaskClientVersion}"
2122
implementation 'org.springframework.boot:spring-boot-starter-web'
2223
implementation platform("org.springframework.boot:spring-boot-dependencies:2.5.2")
2324
implementation 'org.springframework.boot:spring-boot-starter'

samples/src/main/java/io/durabletask/samples/WebAppToDurableTaskSchedulerSample.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import com.azure.core.credential.TokenCredential;
66
import com.microsoft.durabletask.*;
7-
import com.microsoft.durabletask.azuremanaged.client.DurableTaskSchedulerClientExtensions;
8-
import com.microsoft.durabletask.azuremanaged.worker.DurableTaskSchedulerWorkerExtensions;
7+
import com.microsoft.durabletask.client.azuremanaged.DurableTaskSchedulerClientExtensions;
8+
import com.microsoft.durabletask.worker.azuremanaged.DurableTaskSchedulerWorkerExtensions;
99
import org.springframework.boot.SpringApplication;
1010
import org.springframework.boot.autoconfigure.SpringBootApplication;
1111
import org.springframework.web.bind.annotation.*;
@@ -39,7 +39,7 @@ public class WebAppToDurableTaskSchedulerSample {
3939

4040
public static void main(String[] args) {
4141
ConfigurableApplicationContext context = SpringApplication.run(WebAppToDurableTaskSchedulerSample.class, args);
42-
42+
4343
// Get the worker bean and start it
4444
DurableTaskGrpcWorker worker = context.getBean(DurableTaskGrpcWorker.class);
4545
worker.start();
@@ -57,7 +57,7 @@ public TokenCredential tokenCredential() {
5757
public DurableTaskGrpcWorker durableTaskWorker(
5858
DurableTaskProperties properties,
5959
TokenCredential tokenCredential) {
60-
60+
6161
// Create worker using Azure-managed extensions
6262
DurableTaskGrpcWorkerBuilder workerBuilder = DurableTaskSchedulerWorkerExtensions.createWorkerBuilder(
6363
properties.getEndpoint(),
@@ -91,7 +91,7 @@ public TaskOrchestration create() {
9191

9292
// Ship order
9393
String shipmentResult = ctx.callActivity("ShipOrder", orderJson, String.class).await();
94-
94+
9595
// Return the final result
9696
ctx.complete("{\"status\": \"SUCCESS\", " +
9797
"\"payment\": " + paymentResult + ", " +
@@ -152,7 +152,7 @@ public TaskActivity create() {
152152
public DurableTaskClient durableTaskClient(
153153
DurableTaskProperties properties,
154154
TokenCredential tokenCredential) {
155-
155+
156156
// Create client using Azure-managed extensions
157157
return DurableTaskSchedulerClientExtensions.createClientBuilder(
158158
properties.getEndpoint(),
@@ -186,14 +186,14 @@ public OrderController(DurableTaskClient client) {
186186
@PostMapping
187187
public String createOrder(@RequestBody String orderJson) throws Exception {
188188
String instanceId = client.scheduleNewOrchestrationInstance(
189-
"ProcessOrderOrchestration",
189+
"ProcessOrderOrchestration",
190190
orderJson
191191
);
192192

193193
// Wait for the orchestration to complete with a timeout
194194
OrchestrationMetadata metadata = client.waitForInstanceCompletion(
195-
instanceId,
196-
Duration.ofSeconds(30),
195+
instanceId,
196+
Duration.ofSeconds(30),
197197
true
198198
);
199199

@@ -212,4 +212,4 @@ public String getOrder(@PathVariable String instanceId) throws Exception {
212212
}
213213
return metadata.readOutputAs(String.class);
214214
}
215-
}
215+
}

0 commit comments

Comments
 (0)