Files
spring-cloud-function/spring-cloud-function-adapters/spring-cloud-function-grpc-cloudevent-ext
Olga Maciaszek-Sharma 711fcc940e Revert "Update SNAPSHOT to 3.2.4"
This reverts commit 2e7140f2ca.
2022-04-27 10:54:50 +02:00
..
2021-10-18 17:55:33 +02:00
2022-04-27 10:54:50 +02:00

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

To use it simply import it as a dependency to your project together with

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-function-grpc</artifactId>
</dependency>

Your project should also explicitly import CloudEvent 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