Skip to content

Commit

Permalink
[WSO2-Release] [Release 1.0.8] update documentation for release 1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
wso2-jenkins-bot committed Dec 5, 2019
1 parent 0070e46 commit 953ec4e
Show file tree
Hide file tree
Showing 5 changed files with 1,133 additions and 30 deletions.
22 changes: 7 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,16 @@ For information on <a target="_blank" href="https://siddhi.io/">Siddhi</a> and i

## Latest API Docs

Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7">1.0.7</a>.
Latest API Docs is <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8">1.0.8</a>.

## Features

The siddhi-io-grpc have two difference implementations,
* Default gRPC service (<a target="_blank" href="https://github.com/siddhi-io/siddhi-io-grpc/blob/master/component/src/main/resources/EventService.proto">EventService</a>) service
* Generic (Custom) gRPC service implementation

In the default gRPC implementation Siddhi has a predefined gRPC service class called <a target="_blank" href="https://github.com/siddhi-io/siddhi-io-grpc/blob/master/component/src/main/resources/EventService.proto">EventService</a> which can receive and publish events as JSON,XML,Text strings.

In the generic gRPC implementation, we can define a custom gRPC service and use that service with `siddhi-io-grpc` to receive and publish events as `Protobuf` messages. But to that we have to create a jar from the auto-generated Protobuf and gRPC classes and add that jar in to the {SIDDHI_HOME}/jars directory.

* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7/#grpc-sink">grpc</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#sink">Sink</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">gRPC sink will publish events to a given grpc service. We can use this sink when we just want to publish an event from Siddhi, and when we expect empty response back from the gRPC server (Fire and forget). We can also use stream methods (client stream) with this sink to publish stream of requests.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7/#grpc-call-sink">grpc-call</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#sink">Sink</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;"> gRPC-call sink publish events to a given grpc service and expect a response back. In default mode this will use EventService `process` method. `grpc-call-response` source is used to receive the responses. A unique sink.id is used to correlate between the sink and its corresponding source.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7/#grpc-service-response-sink">grpc-service-response</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#sink">Sink</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This extension is used to send responses back to a gRPC client after receiving requests through grpc-service source. This correlates with the particular source using a unique source.id</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7/#grpc-source">grpc</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">gRPC source keep listening to gRPC clients and get the request into the relevant Siddhi streams from those clients. Once the grpc source gets the request from the client it sends an empty response back to the client. We can also use stream methods (client stream) with this source to receive stream of requests that publish from clients.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7/#grpc-call-response-source">grpc-call-response</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This grpc source receives responses received from gRPC server for requests sent from a grpc-call sink. The source will receive responses for sink with the same sink.id. For example if you have a gRPC sink with sink.id 15 then we need to set the sink.id as 15 in the source to receives responses. Sinks and sources have 1:1 mapping</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.7/#grpc-service-source">grpc-service</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">gRPC service source receive requests from gRPC clients and send responses back to those clients. `grpc-service-response` sink is used to send responses back to those clients. A unique source.id is used to correlate between the source and its corresponding sink.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8/#grpc-sink">grpc</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#sink">Sink</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This extension publishes event data encoded into GRPC Classes as defined in the user input jar. This extension has a default gRPC service classes added. The default service is called "EventService". Please find the protobuf definition [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/EventService.proto). If we want to use our custom gRPC services, we have to pack auto-generated gRPC service classes and protobuf classes into a jar file and add it into the project classpath (or to the <code>jars</code> folder in the <code>siddhi-tooling</code> folder if we use it with <code>siddhi-tooling</code>). Please find the custom protobuf definition that uses in examples [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/sample.proto). This grpc sink is used for scenarios where we send a request and don't expect a response back. I.e getting a google.protobuf.Empty response back.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8/#grpc-call-sink">grpc-call</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#sink">Sink</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This extension publishes event data encoded into GRPC Classes as defined in the user input jar. This extension has a default gRPC service classes jar added. The default service is called "EventService". Please find the protobuf definition [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/EventService.proto). If we want to use our custom gRPC services, we have to pack auto-generated gRPC service classes and protobuf classes into a jar file and add it into the project classpath (or to the <code>jars</code> folder in the <code>siddhi-tooling</code> folder if we use it with <code>siddhi-tooling</code>). Please find the custom protobuf definition that uses in examples [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/sample.proto). This grpc-call sink is used for scenarios where we send a request out and expect a response back. In default mode this will use EventService process method. grpc-call-response source is used to receive the responses. A unique sink.id is used to correlate between the sink and its corresponding source.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8/#grpc-service-response-sink">grpc-service-response</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#sink">Sink</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This extension is used to send responses back to a gRPC client after receiving requests through grpc-service source. This correlates with the particular source using a unique source.id</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8/#grpc-source">grpc</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This extension starts a grpc server during initialization time. The server listens to requests from grpc stubs. This source has a default mode of operation and custom user defined grpc service mode. By default this uses EventService. Please find the proto definition [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/EventService.proto). In the default mode this source will use EventService consume method. If we want to use our custom gRPC services, we have to pack auto-generated gRPC service classes and protobuf classes into a jar file and add it into the project classpath (or to the <code>jars</code> folder in the <code>siddhi-tooling</code> folder if we use it with <code>siddhi-tooling</code>). Please find the custom protobuf definition that uses in examples [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/sample.proto). This method will receive requests and injects them into stream through a mapper.</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8/#grpc-call-response-source">grpc-call-response</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This grpc source receives responses received from gRPC server for requests sent from a grpc-call sink. The source will receive responses for sink with the same sink.id. For example if you have a gRPC sink with sink.id 15 then we need to set the sink.id as 15 in the source to receives responses. Sinks and sources have 1:1 mapping</p></p></div>
* <a target="_blank" href="https://siddhi-io.github.io/siddhi-io-grpc/api/1.0.8/#grpc-service-source">grpc-service</a> *(<a target="_blank" href="http://siddhi.io/en/v5.1/docs/query-guide/#source">Source</a>)*<br> <div style="padding-left: 1em;"><p><p style="word-wrap: break-word;margin: 0;">This extension implements a grpc server for receiving and responding to requests. During initialization time a grpc server is started on the user specified port exposing the required service as given in the url. This source also has a default mode and a user defined grpc service mode. By default this uses EventService. Please find the proto definition [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/EventService.proto) In the default mode this will use the EventService process method. If we want to use our custom gRPC services, we have to pack auto-generated gRPC service classes and protobuf classes into a jar file and add it into the project classpath (or to the <code>jars</code> folder in the <code>siddhi-tooling</code> folder if we use it with <code>siddhi-tooling</code>). Please find the custom protobuf definition that uses in examples [here](https://github.com/siddhi-io/siddhi-io-grpc/tree/master/component/src/main/resources/sample.proto). This accepts grpc message class Event as defined in the EventService proto. This uses GrpcServiceResponse sink to send reponses back in the same Event message format.</p></p></div>

## Dependencies

Expand Down
Loading

0 comments on commit 953ec4e

Please sign in to comment.