spring-remoting-grpc

Spring RPC support over gRPC

Лицензия

Лицензия

Категории

Категории

gRPC Сеть Networking
Группа

Группа

com.github.vaibhav-sinha
Идентификатор

Идентификатор

spring-remoting-grpc
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

spring-remoting-grpc
Spring RPC support over gRPC
Ссылка на сайт

Ссылка на сайт

https://github.com/vaibhav-sinha/spring-remoting-grpc
Система контроля версий

Система контроля версий

http://github.com/vaibhav-sinha/spring-remoting-grpc/tree/master

Скачать spring-remoting-grpc

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.vaibhav-sinha/spring-remoting-grpc/ -->
<dependency>
    <groupId>com.github.vaibhav-sinha</groupId>
    <artifactId>spring-remoting-grpc</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.vaibhav-sinha/spring-remoting-grpc/
implementation 'com.github.vaibhav-sinha:spring-remoting-grpc:0.1.0'
// https://jarcasting.com/artifacts/com.github.vaibhav-sinha/spring-remoting-grpc/
implementation ("com.github.vaibhav-sinha:spring-remoting-grpc:0.1.0")
'com.github.vaibhav-sinha:spring-remoting-grpc:jar:0.1.0'
<dependency org="com.github.vaibhav-sinha" name="spring-remoting-grpc" rev="0.1.0">
  <artifact name="spring-remoting-grpc" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.vaibhav-sinha', module='spring-remoting-grpc', version='0.1.0')
)
libraryDependencies += "com.github.vaibhav-sinha" % "spring-remoting-grpc" % "0.1.0"
[com.github.vaibhav-sinha/spring-remoting-grpc "0.1.0"]

Зависимости

compile (7)

Идентификатор библиотеки Тип Версия
org.springframework : spring-core jar 4.3.9.RELEASE
org.springframework : spring-context jar 4.3.9.RELEASE
org.springframework : spring-beans jar 4.3.9.RELEASE
org.springframework : spring-web jar 4.3.9.RELEASE
io.grpc : grpc-netty jar 1.4.0
io.grpc : grpc-protobuf jar 1.4.0
io.grpc : grpc-stub jar 1.4.0

test (2)

Идентификатор библиотеки Тип Версия
org.springframework : spring-test jar 4.3.9.RELEASE
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Spring Remoting gRPC

This library enables using Spring Remoting with gRPC as the underlying transport.

Installation

The artifact is available on Maven Central Repository and can be downloaded by adding the following dependency in pom.xml

<dependency>
    <groupId>com.github.vaibhav-sinha</groupId>
    <artifactId>spring-remoting-grpc</artifactId>
    <version>0.1.0</version>
</dependency>

Usage

Create a Service Exporter bean in the context of the service you want to expose

@Bean
public GrpcInvokerServiceExporter userServiceServer() {
    GrpcInvokerServiceExporter grpcInvokerServiceExporter = new GrpcInvokerServiceExporter();
    grpcInvokerServiceExporter.setServiceInterface(UserService.class);
    grpcInvokerServiceExporter.setService(userService());
    grpcInvokerServiceExporter.setPort(8888);
    return grpcInvokerServiceExporter;
}

Create a Proxy of the service on the client end

@Bean
public UserService userServiceClient() throws Exception {
    return (UserService) grpcInvokerProxyFactoryBean().getObject();
}

@Bean
public GrpcInvokerProxyFactoryBean grpcInvokerProxyFactoryBean() {
    GrpcInvokerProxyFactoryBean grpcInvokerProxyFactoryBean = new GrpcInvokerProxyFactoryBean();
    grpcInvokerProxyFactoryBean.setServiceUrl("localhost:8888");
    grpcInvokerProxyFactoryBean.setServiceInterface(UserService.class);
    return grpcInvokerProxyFactoryBean;
}

Look in the tests to find the complete example.

Версии библиотеки

Версия
0.1.0