Integrate package directory structure
Integrate packages persist in the file system. Each package, except the
core package, is assigned a folder named after it under the
directory. This folder's structure is expected to look like the following:
1 2 3 4 5 6 7 8 9 10
package ├── code ├── conf │ └── esb-package.xml │ └── properties │ └── package.properties │ └── <prefix>.package.properties ├── jars ├── solr ├── web
This directory is meant to contain your services' source files, as well as their corresponding byte code files if any1. Files and directories under this folder must use a valid Java name and identifier. Specifically, they must follow the JLS 6.2 naming guidelines.
Naming files and directories under
Meaningful names are a must when it comes to writing clean code. A meaningful name should describe the purpose of the unit of code in just one glance. Learn more about how to name and organize model and service files here.
This directory contains your package's configuration files.
Contains any extra
.jarfiles necessary for the package. Classes of these JAR files will be registered to your package's classloader and thus, they will be available for use in your code.
Contains the schema files for embedded Solr cores.
This is where optional Java web application resources reside. It can contain web pages which will be used by the embedded Tomcat server to host web applications. If this directory exists, TORO Integrate will add the package as a webapp to the underlying Tomcat web manager. This directory can be used to store a
WEB-INF/web.xmlfile as well.
Every package requires a file named
esb-package.xml in its
conf directory. This file
stores package metadata as well as the following bits of information:
- The Integrate endpoints that belong to the package
- The custom Solr cores linked to the instance which can then be used to index data
- The Spring context files that define the Spring beans that need to be instantiated and included in your package's application context
- The JMS destinations that will be added to the instance's list of broker destinations (if they don't already exist)
It's possible to directly modify the
esb-package.xml file from your file system. Some changes however
may not take effect immediately and may require an instance restart.
Example XML document
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<?xml version="1.0" encoding="UTF-8"?> <esb-package context-path="/examples" documentation-page="https://docs.torocloud.com/integrate/quick-start/resources/examples-package/" id="1.0.0" version="1.0.0" enabled="true" readOnly="false" autoStart="true"> <depends-on-packages /> <startup-services> <startup-service>gloop:io.toro.examples.Prepare/io.toro.examples.Prepare</startup-service> </startup-services> <shutdown-services> <shutdown-service>gloop:io.toro.examples.Cleanup/io.toro.examples.Cleanup</shutdown-service> </shutdown-services> <jms-destinations /> <spring-contexts /> <endpoints> <endpoint type="scheduler" name="AnnouncementScheduler" service="gloop:io.toro.examples.SendAnnouncement/io.toro.examples.SendAnnouncement" enabled="true" modifiable="true"> <properties> <property name="runAs" /> <property name="schedule">simpleRepeating:1</property> <property name="scheduleType">simpleRepeating</property> <property name="documentType">Scheduler</property> <property name="simpleRepeating">1</property> <property name="track">true</property> <property name="stateful">false</property> </properties> </endpoint> </endpoints> <solr-cores /> </esb-package>
.groovy) and Java (
.java) files have
.classfile counterparts. ↩