EventMesh Runtime

The EventMesh Runtime is a stateful mesh node in an EventMesh cluster that is responsible for event transfer between the Source Connector and the Sink Connector, and can use EventMesh Storage as a storage queue for events.

1 Run on your local machine

1.1 Run from source code

1.1.1 Dependencies

  1. 64-bit OSwe recommend Linux/Unix
  2. 64-bit JDK 1.8+;
  3. Gradle 7.0+, we recommend 7.0.*;

1.1.2 Download source code

Download and extract the source code of the latest release from EventMesh download. For example, with the current latest version, you will get apache-eventmesh-1.9.0-source.tar.gz.

1.1.3 Run form local

1.1.3.1 Description of the project structure:

  • eventmesh-common : eventmesh public classes and methods module
  • eventmesh-connector-api : eventmesh connector plugin interface definition module
  • eventmesh-connector-plugin : eventmesh connector plugin module
  • eventmesh-runtime : eventmesh runtime module
  • eventmesh-sdk-java : eventmesh java client sdk
  • eventmesh-starter : eventmesh local startup and runtime project portal
  • eventmesh-spi : eventmesh SPI loader module

Note: Plugin modules follow the SPI specification defined by eventmesh, custom SPI interfaces need to be marked with the annotation @EventMeshSPI. Plugin instances need to be configured in the corresponding module under /main/resources/META-INF/eventmesh with a mapping file of the relevant interfaces to their implementation classes, with the name of the file being the full class name of the SPI interface. The content of the file is the mapping from the plugin instance name to the plugin instance, see eventmesh-connector-rocketmq plugin module for details.

1.1.3.2 Plugin Description

1.1.3.2.1 Installing the plugin

There are two ways to install the plugin

  • classpath loading: Local developers can install the plugin by declaring it in the eventmesh-starter module build.gradle, e.g., declare that it uses the rocketmq plugin
  1. implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq")
  • File loading: By installing the plugin to the plugin directory, EventMesh will automatically load the plugins in the plugin directory according to the conditions at runtime, you can install the plugin by executing the following command
  1. . /gradlew clean jar dist && . /gradlew installPlugin

1.1.3.2.2 Using Plugins

EventMesh will load plugins in the dist/plugin directory by default, you can change the plugin directory with -DeventMeshPluginDir=your_plugin_directory. Examples of plugins to be used at runtime can be found in the confPath directory under eventmesh.properties. For example declare the use of the rocketmq plugin at runtime with the following settings.

  1. #connector plugin
  2. eventMesh.connector.plugin.type=rocketmq

1.1.3.3 Configuring the VM startup parameters

  1. -Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml
  2. -Deventmesh.log.home=eventmesh-runtime/logs
  3. -Deventmesh.home=eventmesh-runtime
  4. -DconfPath=eventmesh-runtime/conf

Note: If your operating system is Windows, you may need to replace the file separator with ‘\‘.

1.1.3.4 Getting up and running

  1. Run org.apache.eventmesh.starter.

1.2 Run form local binary

1.1.1 Dependencies

  1. 64-bit OSwe recommend Linux/Unix
  2. 64-bit JDK 1.8+;
  3. Gradle 7.0+, we recommend 7.0.*;

Gradle is the build automation tool used by Apache EventMesh. Please refer to the offical guide to install the latest release of Gradle.

1.1.2 Download Source Code

Download and extract the source code of the latest release from EventMesh download. For example, with the current latest version, you will get apache-eventmesh-1.9.0-source.tar.gz.

  1. tar -xvzf apache-eventmesh-1.9.0-source.tar.gz
  2. cd apache-eventmesh-1.9.0-src/

Build the source code with Gradle.

  1. gradle clean dist

Edit the eventmesh.properties to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime.

  1. cd dist
  2. vim conf/eventmesh.properties

1.1.3 Build and Load Plugins

Apache EventMesh introduces the SPI (Service Provider Interface) mechanism, which enables EventMesh to discover and load the plugins at runtime. The plugins could be installed with these methods:

  • Gradle Dependencies: Declare the plugins as the build dependencies in eventmesh-starter/build.gradle.
  1. dependencies {
  2. implementation project(":eventmesh-runtime")
  3. // Example: Load the RocketMQ plugin
  4. implementation project(":eventmesh-connectors:eventmesh-connector-rocketmq")
  5. }
  • Plugin directory: EventMesh loads the plugins in the dist/plugin directory based on eventmesh.properties. The installPlugin task of Gradle builds and moves the plugins into the dist/plugin directory.
  1. gradle installPlugin

1.1.4 启动Runtime

Execute the start.sh script to start the EventMesh Runtime server.

  1. bash bin/start.sh

View the output log:

  1. tail -f logs/eventmesh.out

2 Remote deployment

2.1 Dependencies

  1. 64-bit OSwe recommend Linux/Unix
  2. 64-bit JDK 1.8+;
  3. Gradle 7.0+, we recommend 7.0.*;
  4. 4g+ available disk to deploy eventmesh-store;

2.2 Download

Download and extract the executable binaries of the latest release from EventMesh download.For example, with the current latest version, you will get apache-eventmesh-1.9.0.tar.gz.

  1. tar -xvzf apache-eventmesh-1.9.0-bin.tar.gz
  2. cd apache-eventmesh-1.9.0

2.3 Deploy

Edit the eventmesh.properties to change the configuration (e.g. TCP port, client blacklist) of EventMesh Runtime. The executable binaries contain all plugins in the bundle, thus there’s no need to build them from source code.

  1. vim conf/eventmesh.properties

Execute the start.sh script to start the EventMesh Runtime server.

  1. bash bin/start.sh

If you see “EventMeshTCPServer[port=10000] started….” , then the setup was successful.

View the output log:

  1. cd /root/apache-eventmesh-1.9.0/logs
  2. tail -f eventmesh.out

You can stop the run with the following command:

  1. bash bin/stop.sh