Spring Boot starter for automatic configuration of HTTP Invoker in server and client
This project contains two spring-boot starters to simplify the use of Spring HTTP invoker.
spring-boot-autoremote-server-starter
consists of a BeanDefinitionRegistryPostProcessor
that adds HttpInvokerServiceExporter
s 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 RuntimeException
s to avoid ClassNotFoundException
s in the client.
The ExceptionHandler
is also configurable in ExposedServiceConfiguration
.
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.
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>
My project spring-boot uses this library.