Warning: setting this handler overwrite the default handler which takes appropriate measure 44 | * when an invalid message is encountered such as cancelling the stream. This handler should be set 45 | * when control over invalid messages is required.
46 | * 47 | * @param handler the invalid message handler 48 | * @return a reference to this, so the API can be used fluently 49 | */ 50 | @GenIgnore(GenIgnore.PERMITTED_TYPE) 51 | GrpcReadStream14 | * The name of this custom HTTP verb. 15 | *16 | * 17 | *
string kind = 1;
18 | * @return The kind.
19 | */
20 | java.lang.String getKind();
21 | /**
22 | * 23 | * The name of this custom HTTP verb. 24 | *25 | * 26 | *
string kind = 1;
27 | * @return The bytes for kind.
28 | */
29 | com.google.protobuf.ByteString
30 | getKindBytes();
31 |
32 | /**
33 | * 34 | * The path matched by this custom verb. 35 | *36 | * 37 | *
string path = 2;
38 | * @return The path.
39 | */
40 | java.lang.String getPath();
41 | /**
42 | * 43 | * The path matched by this custom verb. 44 | *45 | * 46 | *
string path = 2;
47 | * @return The bytes for path.
48 | */
49 | com.google.protobuf.ByteString
50 | getPathBytes();
51 | }
52 |
--------------------------------------------------------------------------------
/vertx-grpc-docs/src/main/java/com/google/api/HttpOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // NO CHECKED-IN PROTOBUF GENCODE
3 | // source: google/api/http.proto
4 | // Protobuf Java Version: 4.29.3
5 |
6 | package com.google.api;
7 |
8 | public interface HttpOrBuilder extends
9 | // @@protoc_insertion_point(interface_extends:google.api.Http)
10 | com.google.protobuf.MessageOrBuilder {
11 |
12 | /**
13 | * 14 | * A list of HTTP configuration rules that apply to individual API methods. 15 | * 16 | * **NOTE:** All service configuration rules follow "last one wins" order. 17 | *18 | * 19 | *
repeated .google.api.HttpRule rules = 1;
20 | */
21 | java.util.List25 | * A list of HTTP configuration rules that apply to individual API methods. 26 | * 27 | * **NOTE:** All service configuration rules follow "last one wins" order. 28 | *29 | * 30 | *
repeated .google.api.HttpRule rules = 1;
31 | */
32 | com.google.api.HttpRule getRules(int index);
33 | /**
34 | * 35 | * A list of HTTP configuration rules that apply to individual API methods. 36 | * 37 | * **NOTE:** All service configuration rules follow "last one wins" order. 38 | *39 | * 40 | *
repeated .google.api.HttpRule rules = 1;
41 | */
42 | int getRulesCount();
43 | /**
44 | * 45 | * A list of HTTP configuration rules that apply to individual API methods. 46 | * 47 | * **NOTE:** All service configuration rules follow "last one wins" order. 48 | *49 | * 50 | *
repeated .google.api.HttpRule rules = 1;
51 | */
52 | java.util.List extends com.google.api.HttpRuleOrBuilder>
53 | getRulesOrBuilderList();
54 | /**
55 | * 56 | * A list of HTTP configuration rules that apply to individual API methods. 57 | * 58 | * **NOTE:** All service configuration rules follow "last one wins" order. 59 | *60 | * 61 | *
repeated .google.api.HttpRule rules = 1;
62 | */
63 | com.google.api.HttpRuleOrBuilder getRulesOrBuilder(
64 | int index);
65 |
66 | /**
67 | * 68 | * When set to true, URL path parameters will be fully URI-decoded except in 69 | * cases of single segment matches in reserved expansion, where "%2F" will be 70 | * left encoded. 71 | * 72 | * The default behavior is to not decode RFC 6570 reserved characters in multi 73 | * segment matches. 74 | *75 | * 76 | *
bool fully_decode_reserved_expansion = 2;
77 | * @return The fullyDecodeReservedExpansion.
78 | */
79 | boolean getFullyDecodeReservedExpansion();
80 | }
81 |
--------------------------------------------------------------------------------
/vertx-grpc-docs/src/main/java/examples/GrpcContextStorageExamples.java:
--------------------------------------------------------------------------------
1 | package examples;
2 |
3 | import io.grpc.Context;
4 | import io.vertx.core.Vertx;
5 | import io.vertx.docgen.Source;
6 |
7 | @Source
8 | @SuppressWarnings("unused")
9 | public class GrpcContextStorageExamples {
10 |
11 | public void example(Vertx vertx) {
12 | Context grpcCtx1 = Context.current();
13 |
14 | vertx.executeBlocking(() -> {
15 |
16 | // Same as grpcCtx1
17 | Context grpcCtx2 = Context.current();
18 |
19 | return doSomething();
20 |
21 | }).onComplete(ar -> {
22 |
23 | // Same as grpcCtx1 and grpcCtx2
24 | Context grpcCtx3 = Context.current();
25 |
26 | });
27 | }
28 |
29 | private String doSomething() {
30 | return null;
31 | }
32 |
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/vertx-grpc-docs/src/main/java/examples/GrpcIoClientExamples.java:
--------------------------------------------------------------------------------
1 | package examples;
2 |
3 | import examples.grpc.GreeterGrpc;
4 | import examples.grpc.GreeterGrpcIo;
5 | import examples.grpc.HelloReply;
6 | import examples.grpc.HelloRequest;
7 | import io.grpc.stub.StreamObserver;
8 | import io.vertx.core.Future;
9 | import io.vertx.core.Vertx;
10 | import io.vertx.core.net.SocketAddress;
11 | import io.vertx.docgen.Source;
12 | import io.vertx.grpcio.client.GrpcIoClient;
13 | import io.vertx.grpcio.client.GrpcIoClientChannel;
14 |
15 | import java.util.concurrent.TimeUnit;
16 |
17 | @Source
18 | public class GrpcIoClientExamples {
19 |
20 | public void createClient(Vertx vertx) {
21 | GrpcIoClient client = GrpcIoClient.client(vertx);
22 | }
23 |
24 | public void stub(GrpcIoClient client) {
25 |
26 | GrpcIoClientChannel channel = new GrpcIoClientChannel(client, SocketAddress.inetSocketAddress(443, "example.com"));
27 |
28 | GreeterGrpc.GreeterStub greeter = GreeterGrpc.newStub(channel);
29 |
30 | StreamObserverContract definition Greeter service.
27 | */ 28 | public interface Greeter { 29 | 30 | FutureA client for invoking the Greeter gRPC service.
18 | */ 19 | public interface GreeterClient extends Greeter { 20 | 21 | /** 22 | * Calls the SayHello RPC service method. 23 | * 24 | * @param request the examples.grpc.HelloRequest request message 25 | * @return a future of the examples.grpc.HelloReply response message 26 | */ 27 | FutureProvides support for RPC methods implementations of the Greeter gRPC service.
27 | * 28 | *The following methods of this class should be overridden to provide an implementation of the service:
29 | *string message = 1;
14 | * @return The message.
15 | */
16 | java.lang.String getMessage();
17 | /**
18 | * string message = 1;
19 | * @return The bytes for message.
20 | */
21 | com.google.protobuf.ByteString
22 | getMessageBytes();
23 | }
24 |
--------------------------------------------------------------------------------
/vertx-grpc-docs/src/main/java/examples/grpc/HelloRequestOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // NO CHECKED-IN PROTOBUF GENCODE
3 | // source: docs.proto
4 | // Protobuf Java Version: 4.29.3
5 |
6 | package examples.grpc;
7 |
8 | public interface HelloRequestOrBuilder extends
9 | // @@protoc_insertion_point(interface_extends:examples.grpc.HelloRequest)
10 | com.google.protobuf.MessageOrBuilder {
11 |
12 | /**
13 | * string name = 1;
14 | * @return The name.
15 | */
16 | java.lang.String getName();
17 | /**
18 | * string name = 1;
19 | * @return The bytes for name.
20 | */
21 | com.google.protobuf.ByteString
22 | getNameBytes();
23 | }
24 |
--------------------------------------------------------------------------------
/vertx-grpc-docs/src/main/java/examples/grpc/ItemOrBuilder.java:
--------------------------------------------------------------------------------
1 | // Generated by the protocol buffer compiler. DO NOT EDIT!
2 | // NO CHECKED-IN PROTOBUF GENCODE
3 | // source: docs.proto
4 | // Protobuf Java Version: 4.29.3
5 |
6 | package examples.grpc;
7 |
8 | public interface ItemOrBuilder extends
9 | // @@protoc_insertion_point(interface_extends:examples.grpc.Item)
10 | com.google.protobuf.MessageOrBuilder {
11 |
12 | /**
13 | * string value = 1;
14 | * @return The value.
15 | */
16 | java.lang.String getValue();
17 | /**
18 | * string value = 1;
19 | * @return The bytes for value.
20 | */
21 | com.google.protobuf.ByteString
22 | getValueBytes();
23 | }
24 |
--------------------------------------------------------------------------------
/vertx-grpc-docs/src/main/java/examples/grpc/Streaming.java:
--------------------------------------------------------------------------------
1 | package examples.grpc;
2 |
3 | import io.vertx.core.Future;
4 | import io.vertx.core.Promise;
5 | import io.vertx.core.Handler;
6 | import io.vertx.core.http.HttpMethod;
7 | import io.vertx.core.streams.ReadStream;
8 | import io.vertx.core.streams.WriteStream;
9 | import io.vertx.grpc.common.GrpcStatus;
10 | import io.vertx.grpc.common.ServiceName;
11 | import io.vertx.grpc.common.ServiceMethod;
12 | import io.vertx.grpc.common.GrpcMessageDecoder;
13 | import io.vertx.grpc.common.GrpcMessageEncoder;
14 | import io.vertx.grpc.server.GrpcServerRequest;
15 | import io.vertx.grpc.server.GrpcServer;
16 | import io.vertx.grpc.server.Service;
17 | import io.vertx.grpc.server.ServiceBuilder;
18 |
19 | import com.google.protobuf.Descriptors;
20 |
21 | import java.util.LinkedList;
22 | import java.util.ArrayList;
23 | import java.util.List;
24 |
25 | /**
26 | * Contract definition Streaming service.
27 | */ 28 | public interface Streaming { 29 | 30 | FutureProvides support for RPC methods implementations of the Streaming gRPC service.
27 | * 28 | *The following methods of this class should be overridden to provide an implementation of the service:
29 | *Contract definition {{serviceName}} service.
29 | */ 30 | public interface {{contractFqn}} { 31 | {{#unaryUnaryMethods}} 32 | 33 | Future<{{outputType}}> {{vertxMethodName}}({{inputType}} request); 34 | {{/unaryUnaryMethods}} 35 | {{#unaryManyMethods}} 36 | 37 | Future