GH-750 Add support for pluggable protobufs

This initial support adds plugin extension to support CloudEvent proto as well as the example
Additional plugins could be provided in the same ay as CloudEvent plugin extension

Resolves #750
This commit is contained in:
Oleg Zhurakousky
2021-10-11 14:03:24 +02:00
parent 346ff53539
commit 7fc755e157
41 changed files with 2659 additions and 312 deletions

View File

@@ -0,0 +1,40 @@
# Spring Cloud Function gRPC extension to support CloudEvent proto.
This extension project designed as an extension to general Spring Cloud Function gRPC support to specifically suport
[CloudEvent proto](https://github.com/cloudevents/spec/blob/v1.0.1/spec.proto)
To use it simply import it as a dependency to your project together with
```xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-function-grpc</artifactId>
</dependency>
```
Your project should also explicitly import [CloudEvent proto](https://github.com/cloudevents/spec/blob/v1.0.1/spec.proto) and
service proto
```
syntax = "proto3";
package io.cloudevents.v1;
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "CloudEvent.proto";
service CloudEventService {
rpc biStream(stream io.cloudevents.v1.CloudEvent) returns (stream io.cloudevents.v1.CloudEvent);
rpc clientStream(stream io.cloudevents.v1.CloudEvent) returns (io.cloudevents.v1.CloudEvent);
rpc serverStream(io.cloudevents.v1.CloudEvent) returns (stream io.cloudevents.v1.CloudEvent);
rpc requestReply(io.cloudevents.v1.CloudEvent) returns (io.cloudevents.v1.CloudEvent);
}
```
Once done, you can send/receive CloudEvent messages
You can also reference [this sample](https://github.com/spring-cloud/spring-cloud-function/tree/main/spring-cloud-function-samples/function-sample-grpc-cloudevent)