-
Notifications
You must be signed in to change notification settings - Fork 6
How to start new project
If you want to start to implement new integration project (implement new routes) then you have the following options:
Use Maven archetypes for creating new project based on CleverBus. Maven archetype is implemented in web-admin-archetype.
First, build project and install it using mvn install. It builds the project and installs the archetype to your local MVN repository.
Then you can start a new project from archetype cleverbus-server-implementation-archetype using following command:
mvn archetype:generate
-DarchetypeGroupId=org.cleverbus
-DarchetypeArtifactId=cleverbus-server-implementation-archetype
-DarchetypeVersion=<version>
Maven will ask you to input or confirm few additional settings for your project and build the project for you.
After that, go to your new project's directory and build your deployment with mvn package. Your finished build will be ready at target/cleverbus.war. Deploy it to Tomcat or your preferred application server to application context /cleverbus (if you want to use a different application context, please modify the settings in application.cfg, property contextCall.localhostUri appropriately)
After the deployment, an administration console will be available at <server>:<port>/cleverbus/web/login. It is possible to log-in using default credentials webUser / webPassword
This approach supposes to use CleverBus admin as is (without any additional changes) with adding dependencies to external projects/libraries with route implementations. This approach is very similar how works CleverBus extensions, specifically look at How to implement new extensions.
There is one big difference between extensions and adding Project routes to CleverBus - extensions are initialized in own Spring child context but when you add external project routes then you use same Spring context like other routes implemented directly in CleverBus.
This approach has several steps:
- create separated project for route implementations with dependency to CleverBus API (core-api module)
- add dependency to project's artefact (JAR file is expected)
- adjust Spring configuration to initialize Project routes (all in web-admin module)
- add Spring XML configuration file (/src/main/webapp/WEB-INF/spring-ws-servlet.xml)
- add property files (/src/main/webapp/WEB-INF/spring-ws-servlet.xml)
- extend Spring auto-scaning
You can use Dynamic extension loading functionality even if you don't implement extensions, you can use extension/external library concept for initialization.
Use extensions.cfg (or extensions0.cfg) and add parameter for external library.
This approach has advantage that it's not necessary to make changes in CleverBus at all (only set extension properties)