Adapter class not getting invoked when i start the application

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.

Hi @bharatrayipudi,

welcome to the Zeebe community :tada:

With the given information, it is hard to say why it is not working. Please have a look at the docs: GitHub - camunda-community-hub/spring-zeebe: Easily use the Zeebe Java Client in your Spring or Spring Boot projects and the example: spring-zeebe/examples/worker at master · camunda-community-hub/spring-zeebe · GitHub.

Does it work as described?

Best regards,
Philipp