Skip to content

Development

Raymond Meester edited this page Sep 27, 2023 · 20 revisions

This page describes how to set up and build Assimbly for developers.

The project

The Assimbly tries to make Integration solutions. The project activity can be tracked here:

Assimbly uses three Github repositories:

1. Base

The base contains all utils and common dependencies.

https://github.com/assimbly/base

2. Runtime

The Runtime contains all integration logic. The main technologies of the modules are:

  • Broker: Apache ActiveMQ
  • Integration Framework: Apache Camel

https://github.com/assimbly/runtime

3. Gateway

The Gateway contains the web application to manage and configure Assimbly integrations from the browser.

https://github.com/assimbly/gateway

The main technologies of the Gateway are:

  • Backend: Spring Boot
  • Frontend: Angular

You can use any editor or IDE like Intellij, Eclipse or Visual Studio Code.

Prerequisites

Before you can build the project, you must install and configure the following prerequisites on your machine:

  1. JDK 11
  2. GIT
  3. Maven
  4. NodeJS
  5. Jhipster (optional)

If you are on Windows you can also download a Powershell script (Powershell v5 or higher is needed). This script will download and install all prerequisites.

Java version

Assimbly needs Java 11 as minimum

Note: To compile with with a specific JDK we have a toolchains.xml in our .m2 directory. (see also .bat and .sh as examples in the root directory of the Modules project).

Toolchains.xml Example:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<toolchains>
	<!-- JDK toolchains -->
	<toolchain>
		<type>jdk</type>
		<provides>
			<version>8</version>
		</provides>
		<configuration>
			<jdkHome>C:\\Program Files\\Java\\jdk1.8.0_172</jdkHome>
		</configuration>
	</toolchain>
	<toolchain>
		<type>jdk</type>
		<provides>
			<version>11</version>
		</provides>
		<configuration>
			<jdkHome>C:\\Program Files\\AdoptOpenJDK\\jdk-11.0.9.101-hotspot</jdkHome>
		</configuration>
	</toolchain>
</toolchains>

Building the project

Assimbly base

Here are the steps to setup Assimbly Base

git

git clone https://github.com/assimbly/base.git
git fetch
git checkout -t origin/develop

maven

mvn clean install

Assimbly runtime

Here are the steps to setup Assimbly Runtime

git

git clone https://github.com/assimbly/runtime.git
git fetch
git checkout -t origin/develop

maven

mvn clean install

Assimbly Gateway

Here are the steps to setup: Assimbly Gateway. The setup of the connector needs to be finished.

git

git clone https://github.com/assimbly/gateway.git
git fetch
git checkout -t origin/develop

Gradle

Assimbly uses Gradlew (instead of Maven) so the building is a bit different:

./gradlew

Running backend and frontend separately

When running in a separate terminal, you can run the backend/frontend separately:

Backend: gradlew -x webpack

Frontend: npm start

Building for production

To optimize the gateway application for production, run:

./gradlew -Pprod clean bootJar

For Windows, use "gradlew.bat".

To only release the integration application for production, run:

./gradlew -Pintegration -Pprod clean bootJar

To only release the broker application for production, run:

./gradlew -Pbroker -Pprod clean bootJar

The jar file is place in /gateway/build/libs. The -Pprod flag will concatenate and minify the client CSS and JavaScript files. It will also modify index.html so it references these new files.

To ensure everything worked, run:

java -jar build/libs/*.jar

Then navigate to http://localhost:8080 in your browser.

Testing

To launch your application's tests, run:

./gradlew test

Releasing

There are various scripts to build and release Assimbly:

Release guide.

Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the src/main/docker folder to launch required third party services.

For example, to start a mysql database in a docker container, run:

docker-compose -f src/main/docker/mysql.yml up -d

To stop it and remove the container, run:

docker-compose -f src/main/docker/mysql.yml down

You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a docker image of your app by running:

./gradlew bootRepackage -Pprod buildDocker

Then run:

docker-compose -f src/main/docker/app.yml up -d

For more information refer to [Using Docker and Docker-Compose][], this page also contains information on the docker-compose sub-generator (jhipster docker-compose), which is able to generate docker configurations for one or several JHipster applications.

Add a new Camel component

Apache Camel has a lot more components available than supported by Assimbly. To support an extra component there are two steps.

First is adding the maven dependencies to the pom.xml of BaseComponentsModules in Assimbly Modules. Then rebuild the project with:

mvn clean install

If it's an official Camel component then you are done. If it's a custom component you need to perform a second step.

  • In the frontend of the Gateway add it to: src\main\webapp\app\shared\camel\component-type.ts

Now rebuild the gateway as well and test the component. Some components work out-of-the-box other needs some extra requirements (which means some coding :) ).

JHipster

Assimbly gateway was generated using JHipster, you can find documentation and help at http://www.jhipster.tech.

Clone this wiki locally