Skip to content

Commit

Permalink
feat: migrate twitter example to Camunda Spring SDK (#573)
Browse files Browse the repository at this point in the history
  • Loading branch information
megglos authored Jan 8, 2025
1 parent cae1b7d commit 2880430
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
17 changes: 8 additions & 9 deletions twitter-review-java-springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@

<properties>
<java.version>21</java.version>
<spring-boot.version>3.3.0</spring-boot.version>
<zeebe.version>8.5.10</zeebe.version>
<spring-zeebe.version>8.5.7</spring-zeebe.version>
<spring-boot.version>3.3.7</spring-boot.version>
<camunda.version>8.6.7</camunda.version>
<camunda-process-test-coverage.version>2.7.0</camunda-process-test-coverage.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand All @@ -29,7 +28,7 @@
<dependency>
<groupId>io.camunda</groupId>
<artifactId>zeebe-bom</artifactId>
<version>${zeebe.version}</version>
<version>${camunda.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -43,9 +42,9 @@
</dependency>

<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>spring-boot-starter-camunda</artifactId>
<version>${spring-zeebe.version}</version>
<groupId>io.camunda</groupId>
<artifactId>spring-boot-starter-camunda-sdk</artifactId>
<version>${camunda.version}</version>
</dependency>

<dependency>
Expand All @@ -54,9 +53,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<groupId>io.camunda</groupId>
<artifactId>spring-boot-starter-camunda-test</artifactId>
<version>${spring-zeebe.version}</version>
<version>${camunda.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.camunda.community.examples.twitter;

import io.camunda.zeebe.spring.client.EnableZeebeClient;
import io.camunda.zeebe.spring.client.annotation.Deployment;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@EnableZeebeClient
@Deployment(resources = "classpath*:*.bpmn")
public class TwitterExampleApplication {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import io.camunda.zeebe.spring.client.annotation.JobWorker;
import io.camunda.zeebe.spring.client.annotation.VariablesAsType;
import io.camunda.zeebe.spring.client.exception.ZeebeBpmnError;
import io.camunda.zeebe.spring.common.exception.ZeebeBpmnError;
import java.util.Map;
import org.camunda.community.examples.twitter.business.DuplicateTweetException;
import org.camunda.community.examples.twitter.business.TwitterService;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -18,7 +19,8 @@ public void handleTweet(@VariablesAsType TwitterProcessVariables variables) thro
try {
twitterService.tweet(variables.getTweet());
} catch (DuplicateTweetException ex) {
throw new ZeebeBpmnError("duplicateMessage", "Could not post tweet, it is a duplicate.");
throw new ZeebeBpmnError(
"duplicateMessage", "Could not post tweet, it is a duplicate.", Map.of());
}
}

Expand Down

0 comments on commit 2880430

Please sign in to comment.