How to run a custom connector?

Hi folks, I’m trying to build a simple custom connector to learn how to use the Connector SDK, and I want to run my custom connector to connect to Zeebe and pick up jobs from running processes in our self-managed Camunda 8 instance.

I’m following the docs and using the custom connector template.
I’m confused about how to use the Job Worker Connector Run-Time.

I’ve included the job-worker runtime as a maven dependency in my project (based on the template above), and I have wrapped the connector function like this:

public class Main {
    private static final String GATEWAY_ADDRESS = "127.0.0.1:26500";

    public static void main(String[] args) {
        try (ZeebeClient client = ZeebeClient.newClientBuilder()
                .gatewayAddress(GATEWAY_ADDRESS)
                .usePlaintext()
                .build()) {

            client.newTopologyRequest().send().join();

            client.newWorker()
                    .jobType("simple-connector")
                    .handler(new ConnectorJobHandler(new MyConnectorFunction()))
                    .name("SIMPLE_CONNECTOR_WORKER")
                    .fetchVariables("inputValue")
                    .open();
        }
    }
}

I see this part in the docs, but I don’t really understand it:

Pre-packaged runtime environment

The SDK comes with a pre-packaged runtime environment that allows you to run select Connector runtimes as local job workers out-of-the-box. You can find this Java application in the SDK’s GitHub repository, in our artifact store, and on Maven Central.

You can start an instance of this runtime environment with the following command line, given that you defined a Java runtime environment in your system under java:

java -cp 'connector-runtime-job-worker-with-depdencies.jar;connector-template-with-dependencies.jar' \    io.camunda.connector.runtime.jobworker.Main

What are the next steps I should take to run my connector?
Do I need to package my custom connector application as a JAR and pass it to this command?

Thanks,
Kevin

Pick one method.

You can package your connector as a JAR without wrapping it with the maven dependency, then pass it to the java -cp command.

Or you wrap it with the maven dependency and then compile and run your JAR.

Does this make it clearer?

Josh