This plugin
- Configures Jackson for Guava serialisation / deserialisation, so Guava types can be used as input and output to jax-rs Resources
- Configures a Guava EventBus as a Spring Bean (named microserverEventBus)
Simply add to the classpath
Maven
<dependency>
<groupId>com.oath.microservices</groupId>
<artifactId>micro-guava</artifactId>
<version>x.yz</version>
</dependency>
Gradle
compile 'com.oath.microservices:micro-guava:x.yz'
@Rest
@Path("/status")
public class GuavaAppResource {
@POST
@Produces("application/json")
@Path("/ping")
public ImmutableList<String> ping( ImmutableGuavaEntity entity) {
return entity.getList();
}
@POST
@Produces("application/json")
@Path("/optional")
public Optional<String> optional(Jdk8Entity entity) {
return entity.getName();
}
}