-
-
Notifications
You must be signed in to change notification settings - Fork 9
deploy_directory
The deploy directory is a directory where files can be deployed to run on Assimbly.
The deploy directory is located at:
{user.home}/.assimbly/deploy
For example
/Users/jdoe/.assimbly/deploy
Note that the Assimbly base directory is printed in the log after startup:
Currently only XML files can be deployed. Others file types are ignored. These XML files must contain a flow or a route. The following types are allowed:
1. Assimbly format
<?xml version="1.0" encoding="UTF-8"?>
<integrations>
<integration>
<id>1</id>
<name>default</name>
<flows>
<flow>
<id>1</id>
<name>TestFlow</name>
<type>connector</type>
<version>2</version>
<created>2022-05-13T07:26:39.435Z</created>
<lastModified>2022-05-13T08:52:58.949Z</lastModified>
<autostart>false</autostart>
<assimblyHeaders>true</assimblyHeaders>
<parallelProcessing>true</parallelProcessing>
<maximumRedeliveries>0</maximumRedeliveries>
<redeliveryDelay>3000</redeliveryDelay>
<logLevel>OFF</logLevel>
<notes/>
<components>
<component>file</component>
</components>
<endpoints>
<endpoint>
<id>1</id>
<type>from</type>
<uri>file://C:\messages\in</uri>
</endpoint>
<endpoint>
<id>2</id>
<type>to</type>
<uri>file://C:\messages\out2</uri>
</endpoint>
<endpoint>
<id>3</id>
<type>error</type>
<uri>file://C:\messages\error</uri>
</endpoint>
</endpoints>
</flow>
</flows>
<services/>
<headers/>
<routes/>
<routeConfigurations/>
<environmentVariables/>
</integration>
</integrations>
Tip: This file can also be exported from the web application from the deployment page (Administration --> Deployment).
2. CamelContext
A CamelContext.xml contains the error route (onException) and routes:
<camelContext id="ID_62304af4f74a802780000006" xmlns="http://camel.apache.org/schema/blueprint" useMDCLogging="true" streamCache="true">
<onException>
<exception>java.lang.Exception</exception>
<redeliveryPolicy maximumRedeliveries="0" redeliveryDelay="5000"/>
<setExchangePattern pattern="InOut"/>
</onException>
<route id="00306c20-a438-11ec-a4bf-758ef17085f0">
<from uri="jetty:http://0.0.0.0:9000/test"/>
<removeHeaders pattern="CamelHttp*"/>
<split streaming="false" parallelProcessing="false">
<xpath saxon="true" threadSafety="true">/foods/food</xpath>
<setHeader headerName="CamelSplitIndex">
<simple>${exchangeProperty.CamelSplitIndex}</simple>
</setHeader>
<setHeader headerName="CamelSplitSize">
<simple>${exchangeProperty.CamelSplitSize}</simple>
</setHeader>
<setHeader headerName="CamelSplitComplete">
<simple>${exchangeProperty.CamelSplitComplete.toString().trim()}</simple>
</setHeader>
<convertBodyTo type="java.lang.String"/>
<choice>
<when>
<simple>${body} contains 'sub'</simple>
<toD uri="file://C:/test2?autoCreate=true&charset=utf-8&fileExist=Override&consumer.bridgeErrorHandler=true"/>
</when>
<otherwise>
<toD uri="file://C:/test3?autoCreate=true&charset=utf-8&fileExist=Override&consumer.bridgeErrorHandler=true"/>
</otherwise>
</choice>
</split>
<toD uri="file://C:/test1?autoCreate=true&charset=utf-8&fileExist=Override&consumer.bridgeErrorHandler=true"/>
</route>
</camelContext>
3. Route
<routes>
<route>
<from uri="file:C:/messages/in"/>
<to uri="direct:a"/>
</route>
<route>
<from uri="direct:a"/>
<to uri="log:result"/>
</route>
</routes>
- Copy or save the XML file to the deploy directory. To uninstall just delete the file.
or
-
Use the REST API:
- Install REST endpoint: /api/integration/{integrationId}/flow/fileinstall/{flowId}
- Uninstall REST endpoint: /api/integration/{integrationId}/flow/fileuninstall/{flowId}
See the Swagger page (Administration --> API) to try these endpoints.
You need to check to log file if files are sucessfully installed, running or uninstalled. File deployments are not synced with the user interface.
By default Asismbly picks the files in the deploy directory on startup and on file change (create/update/delete). This can be turned off by applying commond line parameters on startup.
- Parameter: application.gateway.deploy-directory.deploy-on-start
- Example: --application.gateway.deploy-directory.deploy-on-start=false
- Explanation: When parameter is set to false, Assimbly ignores the files in the deploy directory.
- Parameter: deploy-on-change
- Example: --application.gateway.deploy-directory.deploy-on-change=false
- Explanation: When parameter is set to false, Assimbly ignores the files changed (create/update/delete) in the deploy directory.
More on command line parameters.