Skip to content

flowx-ai/quickstart-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLOWX Quickstart for Connectors

Codacy Badge Java version String boot version License: MIT

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:

  1. choose a meaningful name for your connector service and set it in the configuration file
  2. decide what topic should the connector listen on and set it in the configuration file
    1. 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.
  3. decide what topic should the connector reply on (this topic name must match the topic pattern the Engine listens on)
  4. adjust number of consumer threads. make sure number of instances * number of threads = number of partitions per topic
  5. define the incoming DTO format
  6. define the outgoing DTO format
  7. implement the business logic for handling messages received from the Engine and sending back a reply
  8. 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

Built with

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) .

Maven settings

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>

Usage

Prerequisites:

A docker-compose file is provided for starting these dependencies locally.

Contributing

Branching model

  • master branch should always have the latest code that is in production.
  • feature/issue_code branches that fix specific github issues
  • feature/feature_name branches for new features
  • bugfix/issue_code branches that fix specific bugs

Code quality

Codacy Badge

License

This project is licensed under the MIT License - see the LICENSE file for details

About

FLOWX Quickstart for Java Connectors

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •