See https://github.com/GoogleCloudPlatform/java-docs-samples/tree/306d2ee4a983b25b3dad7fcf34081039abd40663/flexible/async-rest click first link...