Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Zeebe to version 0.17.0 #55

Merged
merged 1 commit into from
May 17, 2019
Merged
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 @@ -30,7 +30,7 @@ public static class Broker {
public static class Worker {
private String name = DEFAULT.getDefaultJobWorkerName();
private Duration timeout = DEFAULT.getDefaultJobTimeout();
private Integer bufferSize = DEFAULT.getDefaultJobWorkerBufferSize();
private Integer maxJobsActive = DEFAULT.getDefaultJobWorkerMaxJobsActive();
private Duration pollInterval = DEFAULT.getDefaultJobPollInterval();
private Integer threads = DEFAULT.getNumJobWorkerExecutionThreads();
}
Expand All @@ -51,8 +51,8 @@ public int getNumJobWorkerExecutionThreads() {
}

@Override
public int getDefaultJobWorkerBufferSize() {
return worker.bufferSize;
public int getDefaultJobWorkerMaxJobsActive() {
return worker.maxJobsActive;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import io.zeebe.client.api.commands.FailJobCommandStep1;
import io.zeebe.client.api.commands.PublishMessageCommandStep1;
import io.zeebe.client.api.commands.ResolveIncidentCommandStep1;
import io.zeebe.client.api.commands.SetVariablesCommandStep1;
import io.zeebe.client.api.commands.TopologyRequestStep1;
import io.zeebe.client.api.commands.UpdatePayloadWorkflowInstanceCommandStep1;
import io.zeebe.client.api.commands.UpdateRetriesJobCommandStep1;
import io.zeebe.client.api.commands.WorkflowRequestStep1;
import io.zeebe.client.api.commands.WorkflowResourceRequestStep1;
Expand Down Expand Up @@ -84,9 +84,8 @@ public CancelWorkflowInstanceCommandStep1 newCancelInstanceCommand(long workflow
}

@Override
public UpdatePayloadWorkflowInstanceCommandStep1 newUpdatePayloadCommand(
long elementInstanceKey) {
return get().newUpdatePayloadCommand(elementInstanceKey);
public SetVariablesCommandStep1 newSetVariablesCommand(long elementInstanceKey) {
return get().newSetVariablesCommand(elementInstanceKey);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@

long timeout() default 10000L;

int bufferSize() default 2; // FIXME: DEFAULT_TASK_FETCH_SIZE
int maxJobsActive() default 2; // FIXME: DEFAULT_TASK_FETCH_SIZE
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ZeebeWorkerValue implements ZeebeAnnotationValue<MethodInfo> {

private long timeout;

private int bufferSize;
private int maxJobsActive;

private MethodInfo beanInfo;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public Optional<ZeebeWorkerValue> apply(final MethodInfo methodInfo) {
.type(resolver.resolve(annotation.type()))
.name(resolver.resolve(annotation.name()))
.timeout(annotation.timeout())
.bufferSize(annotation.bufferSize())
.maxJobsActive(annotation.maxJobsActive())
.build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Consumer<ZeebeClient> apply(final ClassInfo beanInfo) {
.jobType(m.getType())
.handler((jobClient, job) -> m.getBeanInfo().invoke(jobClient, job))
.name(m.getName())
.bufferSize(m.getBufferSize())
.maxJobsActive(m.getMaxJobsActive())
.timeout(m.getTimeout())
.open();

Expand Down
2 changes: 1 addition & 1 deletion examples/groovy/broker.gsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.zeebe.spring.broker.EnableZeebeBroker
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication

@Grab("io.zeebe.spring:spring-zeebe-broker-starter:0.4.0-SNAPSHOT")
@Grab("io.zeebe.spring:spring-zeebe-broker-starter:0.5.0-SNAPSHOT")
@SpringBootApplication
@EnableZeebeBroker
class Application {
Expand Down
4 changes: 2 additions & 2 deletions examples/groovy/demoProcess.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<bpmn:extensionElements>
<zeebe:taskDefinition type="foo" />
<zeebe:ioMapping>
<zeebe:input source="$.a" target="$.foo" />
<zeebe:output source="$.foo" target="$.bar" />
<zeebe:input source="a" target="foo" />
<zeebe:output source="foo" target="bar" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1sz6737</bpmn:incoming>
Expand Down
8 changes: 4 additions & 4 deletions examples/groovy/job-worker.gsh
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ import io.zeebe.spring.client.annotation.ZeebeWorker
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication

@Grab("io.zeebe.spring:spring-zeebe-starter:0.4.0-SNAPSHOT")
@Grab("io.zeebe.spring:spring-zeebe-starter:0.5.0-SNAPSHOT")
@Slf4j
@SpringBootApplication
@EnableZeebeClient
class Application {

private static void logJob(final ActivatedJob job) {
log.info(
"complete job\n>>> [type: {}, key: {}]\n{deadline; {}]\n[headers: {}]\n[payload: {}]",
"complete job\n>>> [type: {}, key: {}]\n{deadline; {}]\n[headers: {}]\n[variables: {}]",
job.getType(),
job.getKey(),
job.getDeadline().toString(),
job.getHeaders(),
job.getPayload());
job.getVariables());
}

@ZeebeWorker(type = "foo", name = "groovy-worker")
public void handleFooJob(final JobClient client, final ActivatedJob job) {
logJob(job);
client.newCompleteCommand(job.getKey()).payload("{\"foo\": 1}").send().join();
client.newCompleteCommand(job.getKey()).variables("{\"foo\": 1}").send().join();
}

@ZeebeWorker(type = "bar", name = "groovy-worker")
Expand Down
4 changes: 2 additions & 2 deletions examples/groovy/starter.gsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.scheduling.annotation.Scheduled

@Grab("io.zeebe.spring:spring-zeebe-starter:0.4.0-SNAPSHOT")
@Grab("io.zeebe.spring:spring-zeebe-starter:0.5.0-SNAPSHOT")
@Slf4j
@SpringBootApplication
@EnableZeebeClient
Expand All @@ -35,7 +35,7 @@ class Application {
.newCreateInstanceCommand()
.bpmnProcessId("demoProcess")
.latestVersion()
.payload("{\"a\": \"" + UUID.randomUUID().toString() + "\"}")
.variables("{\"a\": \"" + UUID.randomUUID().toString() + "\"}")
.send()
.join();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void startProcesses() {
.newCreateInstanceCommand()
.bpmnProcessId("demoProcess")
.latestVersion()
.payload("{\"a\": \"" + UUID.randomUUID().toString() + "\"}")
.variables("{\"a\": \"" + UUID.randomUUID().toString() + "\"}")
.send()
.join();

Expand Down
4 changes: 2 additions & 2 deletions examples/starter/src/main/resources/demoProcess.bpmn
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<bpmn:extensionElements>
<zeebe:taskDefinition type="foo" />
<zeebe:ioMapping>
<zeebe:input source="$.a" target="$.foo" />
<zeebe:output source="$.foo" target="$.bar" />
<zeebe:input source="a" target="foo" />
<zeebe:output source="foo" target="bar" />
</zeebe:ioMapping>
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_1sz6737</bpmn:incoming>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ public static void main(final String... args) {

private static void logJob(final ActivatedJob job) {
log.info(
"complete job\n>>> [type: {}, key: {}]\n{deadline; {}]\n[headers: {}]\n[payload: {}]",
"complete job\n>>> [type: {}, key: {}]\n{deadline; {}]\n[headers: {}]\n[variables: {}]",
job.getType(),
job.getKey(),
job.getDeadline().toString(),
job.getHeaders(),
job.getPayload());
job.getVariables());
}

@ZeebeWorker(type = "foo")
public void handleFooJob(final JobClient client, final ActivatedJob job) {
logJob(job);
client.newCompleteCommand(job.getKey()).payload("{\"foo\": 1}").send().join();
client.newCompleteCommand(job.getKey()).variables("{\"foo\": 1}").send().join();
}

@ZeebeWorker(type = "bar")
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>

<zeebe.version>0.15.0</zeebe.version>
<zeebe.version>0.17.0</zeebe.version>
<spring-boot.version>2.0.4.RELEASE</spring-boot.version>

<!-- release parent settings for distribution management -->
Expand Down Expand Up @@ -59,7 +59,7 @@
</dependency>
<dependency>
<groupId>io.zeebe</groupId>
<artifactId>zb-bom</artifactId>
<artifactId>zeebe-bom</artifactId>
<version>${zeebe.version}</version>
<scope>import</scope>
<type>pom</type>
Expand Down