Skip to main content
Version: 0.11.11

Build & Test

This section assumes my-connector project has been generated.

Build Connector

Inside the my-connector project directory run build:

$ cdk build
...
Finished `release` profile [optimized] target(s)

The build process generated a binary for your custom connector. We are now ready to test it.

Test Connector

You need a configuration file to start a connector The project automatically generated a sample config sample-config.yaml that we can use as a starting point.

Use cdk test to start the instance:

$ cdk test --config sample-config.yaml
Finished release [optimized] target(s) in 0.16s
Connector runs with process id: 80380
Starting my-connector source connector with CustomConfig { foo: "bar" }

Connector output will be redirected to the current terminal output. To stop running Connector in test mode, press Ctrl+C.

Test Result

The connector produces Hello, Fluvio to the topic test-my-connector-topic. Let's check it out:

$ fluvio consume test-my-connector-topic -B
Hello, Fluvio - 1
Hello, Fluvio - 2
Hello, Fluvio - 3
Hello, Fluvio - 4
...

Checkout the next section, for instructions on how to run the connector in the background.