Skip to content

Latest commit

 

History

History

micro-guava

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Guava Plugin for Microserver

micro-guava example apps

This plugin

  1. Configures Jackson for Guava serialisation / deserialisation, so Guava types can be used as input and output to jax-rs Resources
  2. Configures a Guava EventBus as a Spring Bean (named microserverEventBus)

To use

Simply add to the classpath

Maven Central

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'

Example Guava Resource

@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();
	}

}