Skip to content

Commit

Permalink
[Issue apache#417] update license text and documentation for grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
jinrongluo committed Jan 11, 2022
1 parent 5362d64 commit 1788752
Show file tree
Hide file tree
Showing 18 changed files with 384 additions and 30 deletions.
71 changes: 56 additions & 15 deletions docs/cn/instructions/eventmesh-runtime-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,25 +284,45 @@ message RequestHeader {
string sys = 6;
string username = 7;
string password = 8;
string version = 9;
string language = 10;
string seqNum = 11;
string language = 9;
string protocolType = 10;
string protocolVersion = 11;
string protocolDesc = 12;
}
message Message {
message EventMeshMessage {
RequestHeader header = 1;
string productionGroup = 2;
string producerGroup = 2;
string topic = 3;
string content = 4;
string ttl = 5;
string uniqueId = 6;
string seqNum = 7;
string tag = 8;
map<string, string> properties = 9;
}
message BatchMessage {
RequestHeader header = 1;
string producerGroup = 2;
string topic = 3;
message MessageItem {
string content = 1;
string ttl = 2;
string uniqueId = 3;
string seqNum = 4;
string tag = 5;
map<string, string> properties = 6;
}
repeated MessageItem messageItem = 4;
}
message Response {
string respCode = 1;
string respMsg = 2;
string respTime = 3;
string seqNum = 4;
}
```

Expand All @@ -316,13 +336,23 @@ message Subscription {
string consumerGroup = 2;
message SubscriptionItem {
enum SubscriptionMode {
CLUSTERING = 0;
BROADCASTING = 1;
}
enum SubscriptionType {
ASYNC = 0;
SYNC = 1;
}
string topic = 1;
string mode = 2;
string type = 3;
string url = 4;
SubscriptionMode mode = 2;
SubscriptionType type = 3;
}
repeated SubscriptionItem subscriptionItems = 3;
string url = 4;
}
```

Expand All @@ -332,8 +362,13 @@ message Subscription {

```
message Heartbeat {
enum ClientType {
PUB = 0;
SUB = 1;
}
RequestHeader header = 1;
string clientType = 2;
ClientType clientType = 2;
string producerGroup = 3;
string consumerGroup = 4;
Expand All @@ -351,30 +386,36 @@ message Heartbeat {
- 事件生产端服务 APIs

```
service PublisherService {
# 异步事件生产
rpc publish(Message) returns (Response);
rpc publish(EventMeshMessage) returns (Response);
# 同步事件生产
rpc requestReply(Message) returns (Response);
rpc requestReply(EventMeshMessage) returns (Response);
# 事件广播
rpc broadcast(Message) returns (Response);
# 批量事件生产
rpc batchPublish(BatchMessage) returns (Response);
}
```

- 事件消费端服务 APIs

```
service ConsumerService {
# 所消费事件通过 HTTP Webhook推送事件
rpc subscribe(Subscription) returns (Response);
# 所消费事件通过 TCP stream推送事件
rpc subscribeStream(Subscription) returns (stream Message);
rpc subscribeStream(Subscription) returns (stream EventMeshMessage);
rpc unsubscribe(Subscription) returns (Response);
}
```

- 客户端心跳服务 API

```
service HeartbeatService {
rpc heartbeat(Heartbeat) returns (Response);
}
```
71 changes: 56 additions & 15 deletions docs/en/instructions/eventmesh-runtime-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,45 @@ message RequestHeader {
string sys = 6;
string username = 7;
string password = 8;
string version = 9;
string language = 10;
string seqNum = 11;
string language = 9;
string protocolType = 10;
string protocolVersion = 11;
string protocolDesc = 12;
}
message Message {
message EventMeshMessage {
RequestHeader header = 1;
string productionGroup = 2;
string producerGroup = 2;
string topic = 3;
string content = 4;
string ttl = 5;
string uniqueId = 6;
string seqNum = 7;
string tag = 8;
map<string, string> properties = 9;
}
message BatchMessage {
RequestHeader header = 1;
string producerGroup = 2;
string topic = 3;
message MessageItem {
string content = 1;
string ttl = 2;
string uniqueId = 3;
string seqNum = 4;
string tag = 5;
map<string, string> properties = 6;
}
repeated MessageItem messageItem = 4;
}
message Response {
string respCode = 1;
string respMsg = 2;
string respTime = 3;
string seqNum = 4;
}
```

Expand All @@ -319,13 +339,23 @@ message Subscription {
string consumerGroup = 2;
message SubscriptionItem {
enum SubscriptionMode {
CLUSTERING = 0;
BROADCASTING = 1;
}
enum SubscriptionType {
ASYNC = 0;
SYNC = 1;
}
string topic = 1;
string mode = 2;
string type = 3;
string url = 4;
SubscriptionMode mode = 2;
SubscriptionType type = 3;
}
repeated SubscriptionItem subscriptionItems = 3;
string url = 4;
}
```

Expand All @@ -335,8 +365,13 @@ The following data model is used by `heartbeat()` API.

```
message Heartbeat {
enum ClientType {
PUB = 0;
SUB = 1;
}
RequestHeader header = 1;
string clientType = 2;
ClientType clientType = 2;
string producerGroup = 3;
string consumerGroup = 4;
Expand All @@ -354,30 +389,36 @@ message Heartbeat {
- event publisher service APIs

```
service PublisherService {
# Async event publish
rpc publish(Message) returns (Response);
rpc publish(EventMeshMessage) returns (Response);
# Sync event publish
rpc requestReply(Message) returns (Response);
rpc requestReply(EventMeshMessage) returns (Response);
# event broadcast
rpc broadcast(Message) returns (Response);
# Batch event publish
rpc batchPublish(BatchMessage) returns (Response);
}
```

- event consumer service APIs

```
service ConsumerService {
# The subscribed event will be delivered by invoking the webhook url in the Subscription
rpc subscribe(Subscription) returns (Response);
# The subscribed event will be delivered through stream of Message
rpc subscribeStream(Subscription) returns (stream Message);
rpc subscribeStream(Subscription) returns (stream EventMeshMessage);
rpc unsubscribe(Subscription) returns (Response);
}
```

- client heartbeat service API

```
service HeartbeatService {
rpc heartbeat(Heartbeat) returns (Response);
}
```
Original file line number Diff line number Diff line change
@@ -1,3 +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.
*/

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: eventmesh-client.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +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.
*/

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: eventmesh-client.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +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.
*/

package org.apache.eventmesh.common.protocol.grpc.protos;

import static io.grpc.MethodDescriptor.generateFullMethodName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +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.
*/

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: eventmesh-client.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +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.
*/

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: eventmesh-client.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +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.
*/

// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: eventmesh-client.proto

Expand Down
Loading

0 comments on commit 1788752

Please sign in to comment.