Skip to main content
Version: 0.11.11

Run Connectors on Your Local Machine

Check the Hub for a library of connectors that you can download and run. If the connector you need isn't available, you can build your own. This document will guide you through downloading and running a certified connector from the Hub on your local machine.

1. Download http-source Connector from the Hub

Let's create new directory and download infinyon-http-source@0.3.8 connector from the Hub:

$ mkdir http-source; cd http-source

Use cdk to download the http-source connector:

$ cdk hub download infinyon/http-source@0.3.8

The file has been downloaded to your local machine.

2. Create a Connector Configuration File

Save the following configuration file on your machine:

# quotes-config.yaml
apiVersion: 0.1.0
meta:
version: 0.3.8
name: http-quotes
type: http-source
topic: quotes
http:
endpoint: https://demo-data.infinyon.com/api/quote
interval: 2s

The configuration file ask the http-source connector to read a new quote quote from the demo-data server every 2 seconds.

3. Run the http-source Connector

Use connector .ipkg package file and the configuration file to run the connector:

$ cdk deploy start --ipkg infinyon-http-source-0.3.8.ipkg --config ./quotes-config.yaml

Switch the log level --log-level debug. The log level can be set to trace, debug, info, warn, error.

To check if the connector is running:

$ cdk deploy list

The connector provisioned the quotes topic and it periodically sends a new quote.

4. Check the Result

Read from the fluvio topic:

$ fluvio consume quotes

Show the logs:

$ cdk deploy log --name http-quotes

5. Clean-up

The connector is running in the background. Let's shut it down:

$ cdk deploy shutdown --name http-quotes

We can also delete the topic

$ fluvio topic delete quotes

References