The Adapter class which i used is below…
import java.time.Duration;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import io.zeebe.client.ZeebeClient;
import io.zeebe.client.api.response.ActivatedJob;
import io.zeebe.client.api.worker.JobClient;
import io.zeebe.client.api.worker.JobHandler;
import io.zeebe.client.api.worker.JobWorker;
@Component
public class CatalogAdapter implements JobHandler {
@Autowired
private ZeebeClient zeebe;
private JobWorker subscription;
public CatalogAdapter() {
System.out.println("CatalogAdapter class invoked.......");
}
@PostConstruct
public void subscribe() {
System.out.println("subscribe invoked in CatalogAdapter.........");
subscription = zeebe.newWorker().jobType("catalog-service-z").handler(this).timeout(Duration.ofMinutes(1))
.open();
System.out.println("subscribe completed in CatalogAdapter.........");
}
@Override
public void handle(JobClient client, ActivatedJob job) {
System.out.println("handle() invoked in CatalogAdapter.........");
client.newCompleteCommand(job.getKey()).send().join();
System.out.println("handle() completed in CatalogAdapter.........");
}
@PreDestroy
public void closeSubscription() {
System.out.println("closeSubscription() invoked in CatalogAdapter.........");
subscription.close();
System.out.println("closeSubscription() completed in CatalogAdapter.........");
}
}
Adapter class not getting invoked when i start the application. Cause of this issue i’m not able to invoke the service task.
i Used below specification:
http://camunda.org/schema/zeebe/1.0
<spring.boot.version>2.2.5.RELEASE</spring.boot.version>
<zeebe.version>0.22.1</zeebe.version>
Please suggest me, how to establish the connection.