apache / rocketmq-eventbridge

Apache rocketmq
https://rocketmq.apache.org/
Apache License 2.0
135 stars 49 forks source link

Apache RocketMQ EventBridge

RocketMQ EventBridge is a subproject of rocketmq to make it easier to build event-driven applications. In addition, rocketmq-eventbridge can route events between many services and applications based on the standard CloudEvents 1.0 specification. Users can use rocketmq-eventbridge to build loosely coupled and distributed event-driven architectures.

Architecture

Events are sent to the event bus in two ways: 1) Push events through the SDK or Webhook actively; 2) Pulled events by eventbridge passively. Events obtained in both ways will be stored on the event bus. EventBus is the core concept in EventBridge, which allows you to subscribe to the events, filter the events, and push to the specified target by creating the event rule. The event on the event bus is stored by rocketmq. Through rocketmq-connect, we can pull the event from the register source to the event bus, or push the events from the event bus to the registered target.

image

The code architecture of EventBridge include 4 core modules:

Quick Start

RocketMQ EventBridge rely on a message service to store the event, and needs one connect service to collect or forward events.Here, we choose the Apache RocketMQ as our message service, and choose the Apache RocketMQ Connect as our connect service.Of course, you can also choose other alternative services. Eventbridge do not limit it. You only need to provide the relevant adapter API implementation.

Deploy Apache RocketMQ

Apache RocketMQ is a great messaging service,and we choose it as our message service.You can deploy the apache rocketmq according to the manual: RocketMQ Quick Start

Deploy Apache RocketMQ EventBridge

You can download it from here EventBridge binary package: rocketmq-eventbridge-xxx-bin-release.zip. After downloading, unzip it. You will get a directory as follows:

/rocketmq-eventbridge-xxx-bin-release/
|——bin
|   |——runserver.sh
|   |——eventbridge.sh
|——config
|   |——application.properties
|——plugin
|   |——eventbridge-connect-file-with-dependencies.jar
|   |——connect-filter-transform-with-dependencies.jar
|   |——connect-eventbridge-transform-with-dependencies.jar
|——rocketmq-eventbridge.jar
rocketmq.namesrvAddr=localhost:9876

Note: The downloaded EventBridge binary package may not have permission to execute. You can authorize it in advance through chmod.

sh bin/eventbridge.sh start 

The default log directory is ~/rocketmq-eventbridge/rocketmq-eventbridge.log. You can modify log.path and app.name in config/application.properties to observe whether the service starts normally through the log.

Demo

root % tail -f ~/demo
A test event.
A test event.
A test event.