-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #148] Add connectors documents #150
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,22 +2,49 @@ | |
|
||
## Connector | ||
|
||
A connector is a bridge that interacts with a specific external service or underlying data source (e.g., Databases) on behalf of user applications. A connector is either a Source or a Sink. | ||
A connector is an image or instance that interacts with a specific external service or underlying data source (e.g., Databases) on behalf of user applications. A connector is either a Source or a Sink. | ||
|
||
## Source | ||
|
||
A source connector obtains data from an underlying data producer, and delivers it to targets after original data has been transformed into CloudEvents. It doesn't limit the way how a source retrieves data. (e.g., A source may pull data from a message queue or act as an HTTP server waiting for data sent to it). | ||
|
||
CloudEvents is a specification for describing event data in common formats to provide interoperability across services, platforms and systems. | ||
|
||
## Sink | ||
|
||
A sink connector receives CloudEvents and does some specific business logics. (e.g., A MySQL Sink extracts useful data from CloudEvents and writes them to a MySQL database). | ||
|
||
## CloudEvents | ||
|
||
A specification for describing event data in common formats to provide interoperability across services, platforms and systems. | ||
|
||
## Implements | ||
|
||
Add a new connector by implementing the source/sink interface using [eventmesh-openconnect-java](https://github.com/apache/eventmesh/tree/master/eventmesh-openconnect/eventmesh-openconnect-java). | ||
|
||
## Technical Solution | ||
|
||
### Structure and process | ||
![source-sink connector architecture](https://github.com/apache/eventmesh/assets/13237619/e1897cd6-cc91-4dc4-b6d8-facd7b0538b3) | ||
|
||
### Design Detail | ||
![eventmesh-connect-detail](https://github.com/apache/eventmesh/assets/13237619/bc90925d-8503-4f32-8b5c-5ebc10c13c62) | ||
|
||
### Describe | ||
**Worker** | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
Worker is divided into Source Worker and Sink Worker, which are triggered by the `Application` class and implement the methods of the `ConnectorWorker` interface respectively, which include the worker's running life cycle, and the worker carries the running of the connector. Workers can be lightweight and independent through mirroring Running, the eventmesh-sdk-java module is integrated internally, and the cloudevents protocol is used to interact with eventmesh. Currently, the tcp client is used by default. In the future, support for dynamic configuration can be considered | ||
|
||
**Connector** | ||
|
||
Connectors are divided into Source Connector and Sink Connector. Connectors have their own configuration files and run independently. Workers perform reflective loading and configuration analysis to complete Connector initialization and subsequent operation. Source Connector implements the poll method, and Sink Connector implements The put method uniformly uses `ConnectorRecord` to carry data. Both Source Connector and Sink Connector can operate independently. | ||
|
||
**ConnectorRecord with CloudEvents** | ||
|
||
`ConnectorRecord` is a connector layer data protocol. When workers interact with eventmesh, a protocol adapter needs to be developed to convert `ConnectorRecord` to CloudEvents protocol. | ||
|
||
**Registry** | ||
|
||
The Registry module is responsible for storing the synchronization progress of synchronizing data of different Connector instances, ensuring high availability between multiple Connector images or instances. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which part of the codes does this correspond to? Or is this a plan for the future of Connector? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pandaapo The offsets (consume progress) of connectors are stored in Meta (known as Registry like Nacos) by There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for your answer. |
||
|
||
## Connector Status | ||
|
||
| Connector Name | Source | Sink | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# RabbitMQ | ||
|
||
## RabbitMQSinkConnector: from eventmesh to rabbitmq. | ||
|
||
1. launch your rabbitmq server and eventmesh-runtime. | ||
2. enable sinkConnector and check `sink-config.yml`. | ||
3. send a message to eventmesh with the topic defined in `pubSubConfig.subject` | ||
```yaml | ||
pubSubConfig: | ||
# default port is 10000 | ||
meshAddress: your.eventmesh.server:10000 | ||
subject: TopicTest | ||
idc: FT | ||
env: PRD | ||
group: rabbitmqSink | ||
appId: 5031 | ||
userName: rabbitmqSinkUser | ||
passWord: rabbitmqPassWord | ||
connectorConfig: | ||
connectorName: rabbitmqSink | ||
host: your.rabbitmq.server | ||
port: 5672 | ||
username: coyrqpyz | ||
passwd: passwd | ||
virtualHost: coyrqpyz | ||
exchangeType: TOPIC | ||
# build-in exchangeName or name a new one after you create it in rabbitmq server. | ||
exchangeName: amq.topic | ||
# rabbitmq server will create the routingKey and queueName automatically after you connect to it if they aren't exist before. | ||
routingKey: eventmesh | ||
queueName: eventmesh | ||
autoAck: true | ||
``` | ||
|
||
## RabbitMQSourceConnector: from rabbitmq to eventmesh. | ||
1. launch your rabbitmq server and eventmesh-runtime. | ||
2. enable sourceConnector and check `source-config.yml` (Basically the same as `sink-config.yml`) | ||
3. start your `RabbitMQConnectorServer` and you will find the channel in rabbitmq server. | ||
4. send a cloudevent message to the queue and then you will receive the message in eventmesh. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# RabbitMQ | ||
|
||
## RabbitMQSinkConnector:从 eventmesh 到 rabbitmq。 | ||
|
||
1. 启动你的 rabbitmq 服务和 eventmesh-runtime。 | ||
2. 启用 sinkConnector 并检查 `sink-config.yml`。 | ||
3. 向 eventmesh 发送带有在 `pubSubConfig.subject` 中定义的主题消息。 | ||
```yaml | ||
pubSubConfig: | ||
# 默认端口 10000 | ||
meshAddress: your.eventmesh.server:10000 | ||
subject: TopicTest | ||
idc: FT | ||
env: PRD | ||
group: rabbitmqSink | ||
appId: 5031 | ||
userName: rabbitmqSinkUser | ||
passWord: rabbitmqPassWord | ||
connectorConfig: | ||
connectorName: rabbitmqSink | ||
host: your.rabbitmq.server | ||
port: 5672 | ||
username: coyrqpyz | ||
passwd: passwd | ||
virtualHost: coyrqpyz | ||
exchangeType: TOPIC | ||
# 使用内置的 exchangeName 或在连接到 rabbitmq 服务后创建新的 exchangeName。 | ||
exchangeName: amq.topic | ||
# 如果在连接之前不存在,rabbitmq 服务将自动创建 routingKey 和 queueName。 | ||
routingKey: eventmesh | ||
queueName: eventmesh | ||
autoAck: true | ||
``` | ||
|
||
## RabbitMQSourceConnector:从 rabbitmq 到 eventmesh。 | ||
|
||
1. 启动你的 rabbitmq 服务器和 eventmesh-runtime。 | ||
2. 启用 sourceConnector 并检查 `source-config.yml`(与 sink-config.yml 基本相同)。 | ||
3. 启动你的 RabbitMQConnectorServer,你会在 rabbitmq 服务中找到该channel。 | ||
4. 向队列发送一个 cloudevent 消息,然后你将在 eventmesh 中接收到该消息。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to store images in the `/static/images' path and reference them with a relative link.
In Markdown, it is advisable to have a blank line between the title and the body of the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed