How to start new project?
There are the following steps to start new project with OpenHub framework
There is reference project to see details about implementation new projects based on OpenHub framework.
Create Maven structure
Create new Maven project with reference to parent artifact of OpenHub framework:
<parent> <groupId>org.openhubframework</groupId> <artifactId>openhub</artifactId> <version>2.0.0.RC1</version> </parent>
We recommend to create at least two modules:
- project - module for project specific routes and business logic
- war - module that builds this project and OpenHub framework together
Project module depends on the following OpenHub framework modules:
- openhub-core-api: defines interfaces for new routes implementation
- openhub-test (test): base classes for unit tests
- openhub-components (test): contains implementation of OpenHub components, only necessary when components are used
- openhub-core (test):Â module with core functionality, implements API and SPI interfacesÂ
War module depends on previous project module and the following OpenHub framework modules:
- openhub-web: configures all together, defines OpenHub as web application
- admin-console:Â Admin GUI (optional)
Try ping service at url /http/ping if OpenHub is running successfully.
Start implementing routes
There are several How to articles for beginners:
OpenHub frameworks offers effective way how to create routes based on experience from several years of implementation integration projects. Nevertheless it's up to you which approach do you use, if you use OpenHub's functionality or directly Apache Camel.Â
Our recommendation is to use best from both - use OpenHub framework as base (defines project structure, application stack, offers lot of useful functionality for future use, ...) together with any Camel's functionality you need, also with third-party tools which works with Apache Camel.
OpenHub framework initiates database by Flyway, PostgreSQL and H2 are supported by default.Â
Projects are responsible to define dependencies for specific databases such as JDBC drivers.
OpenHub extensions
There is one alternative way how to implement new integration routes - you can use Dynamic extension loading functionality even if you don't implement extensions directly, you can use extension/external library concept for initialization.
This approach has advantage that you can create self-contained and reusable JAR libraries with functionality that it's possible to share between more projects. Also you don't have to create new project, you can use OpenHub framework as-is and add external libraries via configuration only.