gRPC long polling common 1.0-9

gRPC long polling

License

License

Categories

Categories

Net gRPC Networking
GroupId

GroupId

com.payneteasy.grpc-long-polling
ArtifactId

ArtifactId

grpc-long-polling-common
Last Version

Last Version

1.0-9
Release Date

Release Date

Type

Type

jar
Description

Description

gRPC long polling common 1.0-9
gRPC long polling

Download grpc-long-polling-common

How to add to project

<!-- https://jarcasting.com/artifacts/com.payneteasy.grpc-long-polling/grpc-long-polling-common/ -->
<dependency>
    <groupId>com.payneteasy.grpc-long-polling</groupId>
    <artifactId>grpc-long-polling-common</artifactId>
    <version>1.0-9</version>
</dependency>
// https://jarcasting.com/artifacts/com.payneteasy.grpc-long-polling/grpc-long-polling-common/
implementation 'com.payneteasy.grpc-long-polling:grpc-long-polling-common:1.0-9'
// https://jarcasting.com/artifacts/com.payneteasy.grpc-long-polling/grpc-long-polling-common/
implementation ("com.payneteasy.grpc-long-polling:grpc-long-polling-common:1.0-9")
'com.payneteasy.grpc-long-polling:grpc-long-polling-common:jar:1.0-9'
<dependency org="com.payneteasy.grpc-long-polling" name="grpc-long-polling-common" rev="1.0-9">
  <artifact name="grpc-long-polling-common" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.payneteasy.grpc-long-polling', module='grpc-long-polling-common', version='1.0-9')
)
libraryDependencies += "com.payneteasy.grpc-long-polling" % "grpc-long-polling-common" % "1.0-9"
[com.payneteasy.grpc-long-polling/grpc-long-polling-common "1.0-9"]

Dependencies

compile (5)

Group / Artifact Type Version
com.payneteasy : ber-tlv jar 1.0-8
org.slf4j : slf4j-api jar 1.7.30
com.google.code.findbugs : jsr305 jar 3.0.2
io.grpc : grpc-core jar 1.27.2
commons-io : commons-io jar 2.6

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
ch.qos.logback : logback-classic jar 1.2.3
ch.qos.logback : logback-core jar 1.2.3

Project Modules

There are no modules declared in this project.

gRPC long polling implementation

Build Status Maven Central codecov codebeat badge Codacy Badge Quality Gate Status

Many web servers (ex. nginx), load balancers do not yet support HTTP/2 upstream. This project implemented both gRPC server and client with long polling via HTTP/1.1

Client example

ManagedChannel channel = LongPollingChannelBuilder.forTarget("http://localhost:9096/test").build();
GreeterGrpc.GreeterBlockingStub service = GreeterGrpc
        .newBlockingStub(channel)
        .withDeadlineAfter(5, TimeUnit.SECONDS);

HelloRequest request = HelloRequest.newBuilder().setName("hello").build();
HelloReply reply = service.sayHello(request);

Server example

LongPollingServer pollingServer = new LongPollingServer();

Server grpcServer = LongPollingServerBuilder.forPort(-1)
        .longPollingServer(pollingServer)
        .addService(new GreeterImpl())
        .build();
grpcServer.start();

ServerListener serverListener = pollingServer.waitForServerListener();

HelloWorldServer server = new HelloWorldServer(9096, new LongPollingDispatcherServlet(serverListener));
server.start();

Versions

Version
1.0-9
1.0-8
1.0-7
1.0-5