gRPC long polling 1.0-9

gRPC long polling

License

License

Categories

Categories

Net gRPC Networking
GroupId

GroupId

com.payneteasy
ArtifactId

ArtifactId

grpc-long-polling
Last Version

Last Version

1.0-9
Release Date

Release Date

Type

Type

pom
Description

Description

gRPC long polling 1.0-9
gRPC long polling
Project URL

Project URL

https://github.com/evsinev/grpc-java-long-polling
Source Code Management

Source Code Management

https://github.com/evsinev/grpc-java-long-polling.git

Download grpc-long-polling

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • grpc-long-polling-common
  • grpc-long-polling-client
  • grpc-long-polling-server
  • integration-testing

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