Enterprise Application Integration (EAI)
hila uses EAI routes and templates to move data traffic among services. You can modify existing EAI routes and templates as well as create your own. The platform provides processors to help you integrate your routes and templates with platform functionality.
The concept of EAI routes is based on Apache Camel. See Apache Camel Documentation (external) for more detailed documentation.
In hila, you define EAI routes and templates in the Users > Settings > Enterprise Application Integration menu at the bottom of the hila left nav bar.
Add EAI routes
-
Click the Add Route button in the upper-right corner of the platform.
The Add New Route dialog box appears with two tabs, Simple and Advanced.
-
Simple — This tab is a work in progress.
-
Advanced — Create your own route from scratch.
- Enter a name for the route in the Name text box.
- Click Open Route Body Editor.
The Edit Route Body dialog box appears.
- Add your processor code to the code window.
- Click Save Changes.
-
-
Click Add.
The new route appears in the routes list.
Add EAI templates
You can create a generic EAI code with variables in place of parameters, and that can serve as a template for creating routes with different parameters.
-
Click the Add Template button in the upper-right corner of the platform.
-
Enter a name for the template in the Name text box.
-
Skip the System toggle. This is for Vianai to set a template as a permanent template.
-
Enter any number of tags to add searchable categories to the template.
-
Click Open Route Body Editor to open the Edit Route Body dialog box.
-
Enter your processor code in the code window, making sure to add {{variable_name}} in place of the parameters you want to specify for each route.
For example, if your parameter line for a specific route is<eai:from uri="timer:tick?period=5000"/>
, then change5000
to{{timerPeriod}}
to make:
<eai:from uri="timer:tick?period={{timerPeriod}}"/>
. -
Click Save Changes.
-
Click Add additional field under the Fields heading.
- For each variable field you created in your processor code, add the following info:
- Name — name of the field
- Type — parameter data type
- Required — toggle for whether required or not
- Default — a default value for the parameter
- Click Add for the field.
-
Click the bottom Add button.
The new template appears in the template list.
Create an EAI route from an EAI template
-
Click the route symbol
at the far right of the row for the EAI template (under the Actions column).
The Export to Route dialog box appears.
-
For each field, enter a default value for the route.
-
Click Create New Route.
The new route appears in the route list.
-
If you want to change a route parameter:
- Click the edit icon
for the route.
- Click Open Route Properties Editor to open the Edit Route Properties dialog box.
- Edit the parameter value.
- Click Save Changes.
- Click Update.
- Click the edit icon
Example 1: Set up batch inference from Azure blob to Azure blob
This example shows how to set up an EAI template to send a JSON file with batch inference data from Azure Blob into the platform, and then have the platform send the results back to Azure Blob.
-
Open the platform to the Settings > Enterprise Application Integration page.
-
Open the Templates tab.
-
Click the Add Template button in the upper-right corner of the platform.
-
Enter a name like
az_to_az_batch_inference
in the Name text box. -
Add a tag called “batch-predictor-v2” to the Tags field.
Note: This adds the template and its parameters to the Input dropdown in the deployment wizard for batch deployments.
-
Click Open Route Body Editor to open the Edit Route Body dialog box.
-
Enter the following processor code to the code window:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:eai="http://camel.apache.org/schema/spring" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://camel.apache.org/schema/spring https://camel.apache.org/schema/spring/camel-spring.xsd"> <eai:camelContext> <eai:route> <eai:from uri="azure-storage-blob://{{from_azAccountName}}/{{from_azBucketName}}?accessKey=RAW({{from_azAccountKey}})&scheduler=quartz&scheduler.cron={{cronExpression}}"/> <eai:log message=">>>> Started downloading file [${header.CamelAzureStorageBlobBlobName}]"/> <eai:process ref="login"/> <eai:setHeader name="vianai_deployment_name"> <eai:constant>{{deploymentName}}</eai:constant> </eai:setHeader> <eai:setHeader name="vianai_model_name"> <eai:constant>{{modelName}}</eai:constant> </eai:setHeader> <eai:setHeader name="vianai_model_version"> <eai:constant>{{modelVersion}}</eai:constant> </eai:setHeader> <eai:setHeader name="vianai_method"> <eai:constant>{{method}}</eai:constant> </eai:setHeader> <eai:setHeader name="vianai_stage"> <eai:constant>{{stage}}</eai:constant> </eai:setHeader> <eai:setHeader name="vianai_model_flavor"> <eai:constant>{{modelflavor}}</eai:constant> </eai:setHeader> <eai:process ref="batchPredictorV2"/> <eai:setHeader name="CamelAzureStorageBlobBlobName"> <eai:simple>${header.CamelFileName}</eai:simple> </eai:setHeader> <eai:to uri="azure-storage-blob://{{to_azAccountName}}/{{to_azBucketName}}?accessKey=RAW({{to_azAccountKey}})&operation=uploadBlockBlob"/> <eai:log message=">>>> Finished uploading file [${headers.CamelFileName}]"/> </eai:route> </eai:camelContext> </beans>
-
For each variable, click Add additional field under the Field section and enter a name, type, and whether required based on the following table, then click Add. This assigns each variable to UI fields in the Deployment Wizard.
Name Type Required from_azAccountName string yes from_azBucketName string yes from_azAccountKey string yes cronExpression cron yes deploymentName string yes modelName string yes modelVersion string no method string no stage string no modelflavor string no to_azAccountName string yes to_azBucketName string yes to_azAccountKey string yes -
Click the bottom-most Add button.
-
A new template named az_to_az_batch_inference appears in the templates list.
When you deploy a model for batch inference, this EAI template appears in the Input dropdown.