!!! Work in progress !!!
A starting point to build a NATS Connector to send messages to topics on NATS Servers. You'll need to provide the URL of the NATS Server, the topic you want to publish to, and the message you want to publish in the connector properties:
More information on NATS can be found here
For intermediate catch events you need to set a correlation key in the process using a variable and send the correlation key in the payload as part of the incoming message
You can package the Connector by running the following command:
mvn clean package
This will create the following artifacts:
- A thin JAR without dependencies.
- An uber JAR containing all dependencies, potentially shaded to avoid classpath conflicts. This will not include the SDK artifacts since those are in scope
provided
and will be brought along by the respective Connector Runtime executing the Connector.
You can use the maven-shade-plugin
defined in the Maven configuration to relocate common dependencies
that are used in other Connectors and the Connector Runtime.
This helps to avoid classpath conflicts when the Connector is executed.
Use the relocations
configuration in the Maven Shade plugin to define the dependencies that should be shaded.
The Maven Shade documentation
provides more details on relocations.
This Connector can be configured with the following properties:
Name | Description | Example |
---|---|---|
NATS URL | URL of NATS Server | localhost:4222 |
Topic | Topic on NATS Server to monitor | sampleTopic |
Polling interval | Long polling interval in seconds | 60 |
This Connector produces the following output:
{
"event": {
"url": "localhost:4222",
"topic": "sampleTopic",
"message": "some message"
}
}
Run unit tests
mvn clean verify
Use the Camunda Connector Runtime to run your function as a local Java application.
In your IDE you can also simply navigate to the LocalContainerRuntime
class in test scope and run it via your IDE.
If necessary, you can adjust application.properties
in test scope.
The element templates can be found in the element-templates directory.
- Add stuff like authentication and outputs and additional functionality