|
1 | 1 | package io.netifi.proteus.quickstart.service.protobuf; |
2 | 2 |
|
3 | 3 | @javax.annotation.Generated( |
4 | | - value = "by Proteus proto compiler (version 0.7.15)", |
| 4 | + value = "by RSocket RPC proto compiler", |
5 | 5 | comments = "Source: io/netifi/proteus/quickstart/service/protobuf/service.proto") |
6 | | -@io.netifi.proteus.annotations.internal.ProteusGenerated( |
7 | | - type = io.netifi.proteus.annotations.internal.ProteusResourceType.CLIENT, |
| 6 | +@io.rsocket.rpc.annotations.internal.Generated( |
| 7 | + type = io.rsocket.rpc.annotations.internal.ResourceType.CLIENT, |
8 | 8 | idlClass = HelloService.class) |
9 | 9 | public final class HelloServiceClient implements HelloService { |
10 | 10 | private final io.rsocket.RSocket rSocket; |
11 | 11 | private final java.util.function.Function<? super org.reactivestreams.Publisher<io.netifi.proteus.quickstart.service.protobuf.HelloResponse>, ? extends org.reactivestreams.Publisher<io.netifi.proteus.quickstart.service.protobuf.HelloResponse>> sayHello; |
| 12 | + private final java.util.function.Function<java.util.Map<String, String>, java.util.function.Function<? super org.reactivestreams.Publisher<io.netifi.proteus.quickstart.service.protobuf.HelloResponse>, ? extends org.reactivestreams.Publisher<io.netifi.proteus.quickstart.service.protobuf.HelloResponse>>> sayHelloTrace; |
12 | 13 |
|
13 | 14 | public HelloServiceClient(io.rsocket.RSocket rSocket) { |
14 | 15 | this.rSocket = rSocket; |
15 | 16 | this.sayHello = java.util.function.Function.identity(); |
| 17 | + this.sayHelloTrace = io.rsocket.rpc.tracing.Tracing.trace(); |
16 | 18 | } |
17 | 19 |
|
18 | 20 | public HelloServiceClient(io.rsocket.RSocket rSocket, io.micrometer.core.instrument.MeterRegistry registry) { |
19 | 21 | this.rSocket = rSocket; |
20 | | - this.sayHello = io.netifi.proteus.metrics.ProteusMetrics.timed(registry, "proteus.client", "service", HelloService.SERVICE, "method", HelloService.METHOD_SAY_HELLO); |
| 22 | + this.sayHello = io.rsocket.rpc.metrics.Metrics.timed(registry, "rsocket.client", "service", HelloService.SERVICE, "method", HelloService.METHOD_SAY_HELLO); |
| 23 | + this.sayHelloTrace = io.rsocket.rpc.tracing.Tracing.trace(); |
21 | 24 | } |
22 | 25 |
|
| 26 | + |
| 27 | + public HelloServiceClient(io.rsocket.RSocket rSocket, io.opentracing.Tracer tracer) { |
| 28 | + this.rSocket = rSocket; |
| 29 | + this.sayHello = java.util.function.Function.identity(); |
| 30 | + this.sayHelloTrace = io.rsocket.rpc.tracing.Tracing.trace(tracer, HelloService.METHOD_SAY_HELLO, io.rsocket.rpc.tracing.Tag.of("rsocket.service", HelloService.SERVICE), io.rsocket.rpc.tracing.Tag.of("rsocket.rpc.role", "client"), io.rsocket.rpc.tracing.Tag.of("rsocket.rpc.version", "")); |
| 31 | + } |
| 32 | + |
| 33 | + |
| 34 | + public HelloServiceClient(io.rsocket.RSocket rSocket, io.micrometer.core.instrument.MeterRegistry registry, io.opentracing.Tracer tracer) { |
| 35 | + this.rSocket = rSocket; |
| 36 | + this.sayHello = io.rsocket.rpc.metrics.Metrics.timed(registry, "rsocket.client", "service", HelloService.SERVICE, "method", HelloService.METHOD_SAY_HELLO); |
| 37 | + this.sayHelloTrace = io.rsocket.rpc.tracing.Tracing.trace(tracer, HelloService.METHOD_SAY_HELLO, io.rsocket.rpc.tracing.Tag.of("rsocket.service", HelloService.SERVICE), io.rsocket.rpc.tracing.Tag.of("rsocket.rpc.role", "client"), io.rsocket.rpc.tracing.Tag.of("rsocket.rpc.version", "")); |
| 38 | + } |
| 39 | + |
| 40 | + @io.rsocket.rpc.annotations.internal.GeneratedMethod(returnTypeClass = io.netifi.proteus.quickstart.service.protobuf.HelloResponse.class) |
23 | 41 | public reactor.core.publisher.Mono<io.netifi.proteus.quickstart.service.protobuf.HelloResponse> sayHello(io.netifi.proteus.quickstart.service.protobuf.HelloRequest message) { |
24 | 42 | return sayHello(message, io.netty.buffer.Unpooled.EMPTY_BUFFER); |
25 | 43 | } |
26 | 44 |
|
27 | 45 | @java.lang.Override |
| 46 | + @io.rsocket.rpc.annotations.internal.GeneratedMethod(returnTypeClass = io.netifi.proteus.quickstart.service.protobuf.HelloResponse.class) |
28 | 47 | public reactor.core.publisher.Mono<io.netifi.proteus.quickstart.service.protobuf.HelloResponse> sayHello(io.netifi.proteus.quickstart.service.protobuf.HelloRequest message, io.netty.buffer.ByteBuf metadata) { |
| 48 | + java.util.Map<String, String> map = new java.util.HashMap<>(); |
29 | 49 | return reactor.core.publisher.Mono.defer(new java.util.function.Supplier<reactor.core.publisher.Mono<io.rsocket.Payload>>() { |
30 | 50 | @java.lang.Override |
31 | 51 | public reactor.core.publisher.Mono<io.rsocket.Payload> get() { |
32 | | - final io.netty.buffer.ByteBuf metadataBuf = io.netifi.proteus.frames.ProteusMetadata.encode(io.netty.buffer.ByteBufAllocator.DEFAULT, HelloService.SERVICE, HelloService.METHOD_SAY_HELLO, metadata); |
33 | | - io.netty.buffer.ByteBuf data = serialize(message); |
| 52 | + final io.netty.buffer.ByteBuf data = serialize(message); |
| 53 | + final io.netty.buffer.ByteBuf tracing = io.rsocket.rpc.tracing.Tracing.mapToByteBuf(io.netty.buffer.ByteBufAllocator.DEFAULT, map); |
| 54 | + final io.netty.buffer.ByteBuf metadataBuf = io.rsocket.rpc.frames.Metadata.encode(io.netty.buffer.ByteBufAllocator.DEFAULT, HelloService.SERVICE, HelloService.METHOD_SAY_HELLO, tracing, metadata); |
| 55 | + tracing.release(); |
| 56 | + metadata.release(); |
34 | 57 | return rSocket.requestResponse(io.rsocket.util.ByteBufPayload.create(data, metadataBuf)); |
35 | 58 | } |
36 | | - }).map(deserializer(io.netifi.proteus.quickstart.service.protobuf.HelloResponse.parser())).transform(sayHello); |
| 59 | + }).map(deserializer(io.netifi.proteus.quickstart.service.protobuf.HelloResponse.parser())).transform(sayHello).transform(sayHelloTrace.apply(map)); |
37 | 60 | } |
38 | 61 |
|
39 | 62 | private static io.netty.buffer.ByteBuf serialize(final com.google.protobuf.MessageLite message) { |
|
0 commit comments