A sample for dirigible integrations module. This sample shows the following 3 topics:
- How to use the Designer to create/modify routes.
- How to invoke Dirigible
*.mjs
files via Camel routes, - How to invoke Camel routes from Dirigible
*.mjs
files via thesdk/integrations
API - How to use the built in
Camel FTP
component to save data as a file in an FTP Server.
- To run this project you need to add the following dependencies:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-ftp</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-direct-starter</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-direct</artifactId>
<version>${camel.version}</version>
</dependency>
to components/engine/engine-camel/pom.xml
then build/run Eclipse Dirigible.
- Import the
/camel
folder of this repository as a zip in Eclipse Dirigible via the import feature in the UI. - As one of the routes uses the
FTP Component
you can run a local FTP server withFileZilla Server
routes.camel
contains the routes definitions for the following two routes:
route-3c7a
this route can be called with a POST request to http://localhost:8080/services/integrations/endpoint and it will callhandler.js
with the HTTP request payload and then save the final processing result to a localhost:21 FTP server with user test and no password.route-bda8
a direct route that is called byrouteInvoker.mjs
that modifies the message provided byrouteInvoker.mjs
and returns it as a response.
Rest services are not included in this sample, but they can be created in the REST
tab of the camel editor and they call direct routes defined in the Routes
tab.