Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p-wunderlich/c8-inbound-file-watch-connector
https://github.com/p-wunderlich/c8-inbound-file-watch-connector
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/p-wunderlich/c8-inbound-file-watch-connector
- Owner: p-wunderlich
- License: apache-2.0
- Created: 2024-06-04T13:35:46.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-04T13:37:29.000Z (7 months ago)
- Last Synced: 2024-09-09T14:08:58.690Z (4 months ago)
- Language: Java
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C8 File Watch Connector
Example from Camunda Academy https://academy.camunda.com/c8-custom-inbound-connectors/1825425 based on the camunda template here https://github.com/camunda/connector-template-inbound/.
## Build
You can package the Connector by running the following command:
```bash
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.### Shading dependencies
You can use the `maven-shade-plugin` defined in the [Maven configuration](./pom.xml) to relocate common dependencies
that are used in other Connectors and the [Connector Runtime](https://github.com/camunda-community-hub/spring-zeebe/tree/master/connector-runtime#building-connector-runtime-bundles).
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](https://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html)
provides more details on relocations.## API
### Connector Properties
This Connector can be configured with the following properties:
| Name | Description | Example | Can be a secret |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|-----------------|
| sender | Value of the `sender` field of the messages generated by [`MockSubscription`](https://github.com/camunda/c8-inbound-file-watch-connector/blob/main/src/main/java/io/camunda/connector/inbound/subscription/MockSubscription.java) | `Alice` | Yes |
| messagesPerMinute | How many messages per minute should MockSubscription produce (1-10) | `3` | No |### Output
This Connector produces the following output:
```json
{
"event": {
"sender": ".....",
"message": ".....",
"code": 999
}
}
```## Test locally
Run unit tests
```bash
mvn clean verify
```### Test with local runtime
Use the [Camunda Connector Runtime](https://github.com/camunda-community-hub/spring-zeebe/tree/master/connector-runtime#building-connector-runtime-bundles) 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.## Element Template
The element templates can be found in the [element-templates/inbound-template-connector.json](element-templates/file-watch-start-connector.json) file.