Skip to content

Commit

Permalink
[ISSUE apache#4686] Shell scripts should preserve LF line endings (ap…
Browse files Browse the repository at this point in the history
…ache#4687)

* crlf2lf

* convert sh only

* write easily

* Some doc optimization

* minor code change

* add future win scrpts

* add license
  • Loading branch information
Pil0tXia authored Jan 6, 2024
1 parent c3326c0 commit a43357c
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 13 deletions.
20 changes: 20 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
*.sh text eol=lf
gradlew text eol=lf
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
1 change: 1 addition & 0 deletions eventmesh-connectors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Connector

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.

Connector runs as a standalone service by `main()`.

## Source
Expand Down
4 changes: 3 additions & 1 deletion eventmesh-connectors/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## 连接器类型

连接器是代表用户应用程序与特定外部服务或底层数据源(例如数据库)交互的镜像或实例。连接器的类型可以是源(Source)或汇(Sink)。连接器通过 `main()` 作为一个独立服务运行
连接器是代表用户应用程序与特定外部服务或底层数据源(例如数据库)交互的镜像或实例。连接器的类型可以是源(Source)或汇(Sink)。

连接器通过 `main()` 作为一个独立服务运行。

## 数据源(Source 端)

Expand Down
6 changes: 3 additions & 3 deletions eventmesh-connectors/eventmesh-connector-mongodb/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ connectorConfig:
## MongoDBSourceConnector:从 MongoDB 到 EventMesh
1. 启动你的 MongoDB 服务和 EventMesh Runtime。
2. 启用 sourceConnector 并检查 `source-config.yml`(与 sink-config.yml 基本相同)。
3. 启动你的 MongoDBSourceConnector,它将订阅到 mongodb 中的 `connectorConfig.collection`,并将数据发送到 EventMesh Runtime 中的 `pubSubConfig.subject`。
1. 启动你的 MongoDB 服务和 EventMesh Runtime。
2. 启用 sourceConnector 并检查 `source-config.yml`(与 sink-config.yml 基本相同)。
3. 启动你的 MongoDBSourceConnector,它将订阅到 MongoDB 中的 `connectorConfig.collection`,并将数据发送到 EventMesh Runtime 中的 `pubSubConfig.subject`。
4. 向 MongoDB 中 `yourDB` 的 `yourCol` 写入一个 CloudEvent 消息,然后你将在 EventMesh 中接收到该消息。
12 changes: 6 additions & 6 deletions eventmesh-connectors/eventmesh-connector-rabbitmq/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## RabbitMQSinkConnector:从 EventMesh 到 RabbitMQ

1. 启动你的 RabbitMQ 服务和 EventMesh Runtime。
1. 启动你的 RabbitMQ EventMesh Runtime。
2. 启用 sinkConnector 并检查 `sink-config.yml`
3. 启动你的 RabbitMQConnectorServer,它将订阅到 EventMesh Runtime 中 `pubSubConfig.subject` 中定义的主题,并将数据发送到 RabbitMQ 中的 `connectorConfig.queueName`
4. 使用在 `pubSubConfig.subject` 中指定的 Topic,向 EventMesh 发送消息,然后你将在 rabbitmq 中接收到该消息。
4. 使用在 `pubSubConfig.subject` 中指定的 Topic,向 EventMesh 发送消息,然后你将在 RabbitMQ 中接收到该消息。

```yaml
pubSubConfig:
Expand All @@ -26,17 +26,17 @@ connectorConfig:
passwd: passwd
virtualHost: coyrqpyz
exchangeType: TOPIC
# 使用内置的 exchangeName 或在连接到 rabbitmq 服务后创建新的 exchangeName。
# 使用内置的 exchangeName 或在连接到 RabbitMQ 后创建新的 exchangeName。
exchangeName: amq.topic
# 如果在连接之前不存在,rabbitmq 服务将自动创建 routingKey 和 queueName。
# 如果在连接之前不存在,RabbitMQ 将自动创建 routingKey 和 queueName。
routingKey: eventmesh
queueName: eventmesh
autoAck: true
```
## RabbitMQSourceConnector:从 RabbitMQ 到 EventMesh
1. 启动你的 RabbitMQ 服务和 EventMesh Runtime。
2. 启用 sourceConnector 并检查 `source-config.yml`(与 sink-config.yml 基本相同)。
1. 启动你的 RabbitMQ EventMesh Runtime。
2. 启用 sourceConnector 并检查 `source-config.yml`(与 sink-config.yml 基本相同)。
3. 启动你的 RabbitMQConnectorServer,它将订阅到 RabbitMQ 中的 `connectorConfig.queueName`,并将数据发送到 EventMesh Runtime 中的 `pubSubConfig.subject`。
4. 向队列发送一个 CloudEvent 消息,然后你将在 EventMesh 中接收到该消息。
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pubSubConfig:
connectorConfig:
connectorName: redisSink
server: redis://127.0.0.1:6379
# redis 中的主题
# Redis 中的主题
topic: SinkTopic
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ public void tryHTTPRequest() {
.get(handleMsgContext.getTopic()).getHttpAuthTypeMap().get(currPushUrl);

WebhookUtil.setWebhookHeaders(builder, httpEntity.getContentType().getValue(),
eventMeshHttpConfiguration.getEventMeshWebhookOrigin(),
urlAuthType);
eventMeshHttpConfiguration.getEventMeshWebhookOrigin(), urlAuthType);

eventMeshHTTPServer.getMetrics().getSummaryMetrics().recordPushMsg();

Expand Down

0 comments on commit a43357c

Please sign in to comment.