Skip to content

Spring Boot starter for automatic configuration of HTTP Invoker in server and client

License

Notifications You must be signed in to change notification settings

martinfoersterling/spring-boot-autoremote

Repository files navigation

spring-boot-autoremote

Build Status codecov License: MIT Dependency Status

Spring Boot starter for automatic configuration of HTTP Invoker in server and client

What it does

This project contains two spring-boot starters to simplify the use of Spring HTTP invoker.

Server-side (expose services)

spring-boot-autoremote-server-starter consists of a BeanDefinitionRegistryPostProcessor that adds HttpInvokerServiceExporters for each service annotated with ExposedService.

This exposes the services on the server as endpoints, so that any client can access them.

You need to add

<dependency>
    <groupId>com.github.martinfoersterling.spring-boot-autoremote</groupId>
    <artifactId>spring-boot-autoremote-server-starter</artifactId>
    <version>1.1</version>
</dependency>

to your pom.xml and define a bean derived from ExposedServiceConfiguration to

ExposedServiceConfiguration also offers a way to customize the RemoteInvocationExecutor to be used. Per default, a simple executor will be used that transforms all exceptions into RuntimeExceptions to avoid ClassNotFoundExceptions in the client.

The ExceptionHandler is also configurable in ExposedServiceConfiguration.

Client-side (consume services)

spring-boot-autoremote-client-starter also consists of a BeanDefinitionRegistryPostProcessor, here adding HttpInvokerProxyFactoryBean instances for a number of service interfaces.

This consumes the service endpoints on the server via a proxy bean, so that the client can call service methods as if they were local.

You need to add

<dependency>
    <groupId>com.github.martinfoersterling.spring-boot-autoremote</groupId>
    <artifactId>spring-boot-autoremote-client-starter</artifactId>
    <version>1.1</version>
</dependency>

to your pom.xml and define a bean derived from ConsumeServiceConfiguration listing a number of service interfaces and configuring the URL of the server.

Dependencies

In order for your build to find the JARs, you need to add jitpack as repository.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Example

My project spring-boot uses this library.

About

Spring Boot starter for automatic configuration of HTTP Invoker in server and client

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages