Skip to content

dirigiblelabs/sample-camel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Dirigible Integrations - Sample

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 the sdk/integrations API
  • How to use the built in Camel FTP component to save data as a file in an FTP Server.

Prerequisites

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

  1. Import the /camel folder of this repository as a zip in Eclipse Dirigible via the import feature in the UI.
  2. As one of the routes uses the FTP Component you can run a local FTP server with FileZilla Server
    • You have to setup the FTP server listen on localhost:21 with user 'test' and no auth password for this example. Screenshot 2024-06-28 at 15 49 17
Screenshot 2024-06-28 at 15 27 14

Routes

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 call handler.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 by routeInvoker.mjs that modifies the message provided by routeInvoker.mjs and returns it as a response.
Screenshot 2024-06-28 at 15 35 51

Bonus

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. Screenshot 2024-06-28 at 15 37 15

About

Sample for dirigible integrations module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published