Basic setup for a connector. To be used as starting point for FLOWX connectors.
You can see an implementation example for a simple currency exchange connector here.
Includes:
- Kafka related configs and listener & message sender examples
- Jaeger related configs & example
- config example for activating custom health checks
Please check and follow the TODOs in the code for implementing your own custom FLOWX connector:
- choose a meaningful name for your connector service and set it in the configuration file
- decide what topic should the connector listen on and set it in the configuration file
- if the connector needs to listen on more than one topic, make sure to add settings & configure a separate thread pool executor for each needed topic. Please see
KafkaConfiguration
for an example configuration.
- if the connector needs to listen on more than one topic, make sure to add settings & configure a separate thread pool executor for each needed topic. Please see
- decide what topic should the connector reply on (this topic name must match the topic pattern the Engine listens on)
- adjust number of consumer threads. make sure number of instances * number of threads = number of partitions per topic
- define the incoming DTO format
- define the outgoing DTO format
- implement the business logic for handling messages received from the Engine and sending back a reply
- make sure to send back the process instance uuid as a key for the Kafka message
optional steps:
- decide whether you want to use jaeger tracing in your setup and choose a prefix name in teh configuration file
- enable health check for all the services you use in the service
Built with | Usage | Contributing | License
Java 17 & Spring Boot 3.2.9
Uses some custom libraries which are available on github packages. To be able to download them using maven, you need to authenticate to github using a personal access token with read:packages
scope (go to you github account -> settings -> developer settings - > personal access tokens -> tokens (classic) -> generate new token).
An error might occur if you run your project using Intellij, to prevent it you need to delegate IDE build/run action to maven (go to preferences -> maven -> runner -> check the delegate IDE build/run action to maven
checkbox) .
Update settings (Source: Github Maven Packages):
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/flowx-ai/public-mvn-packages</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>USERNAME</username>
<password>TOKEN</password>
</server>
</servers>
</settings>
Prerequisites:
A docker-compose file is provided for starting these dependencies locally.
master
branch should always have the latest code that is in production.feature/issue_code
branches that fix specific github issuesfeature/feature_name
branches for new featuresbugfix/issue_code
branches that fix specific bugs
This project is licensed under the MIT License - see the LICENSE file for details