diff --git a/docs/html5/configuration.html b/docs/html5/configuration.html index 482c809..63cde39 100644 --- a/docs/html5/configuration.html +++ b/docs/html5/configuration.html @@ -528,11 +528,38 @@ SequentialHookRunner that has run loop around queue pop and publishes the hook r

The clients of whoas library can add "whoas" configuration to build queue and runner of their choice. See the example below

+
+ +
whoas:
   queue:
     type: "com.github.lookout.whoas.RedisQueue"
+    key: "queue"
     hostname: "localhost"
     port: 6379
   runnerType: "com.github.lookout.whoas.SequentialHookRunner"
@@ -543,7 +570,7 @@ See the example below

diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookQueue.html b/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookQueue.html index 5ef796a..00b3c68 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookQueue.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookQueue.html @@ -6,9 +6,9 @@ - + AbstractHookQueue (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookRunner.html b/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookRunner.html index 6e3d074..566748a 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookRunner.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/AbstractHookRunner.html @@ -6,9 +6,9 @@ - + AbstractHookRunner (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/HookRequest.html b/docs/html5/groovydoc/com/github/lookout/whoas/HookRequest.html index cc414ff..a67c534 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/HookRequest.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/HookRequest.html @@ -6,9 +6,9 @@ - + HookRequest (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/InMemoryQueue.html b/docs/html5/groovydoc/com/github/lookout/whoas/InMemoryQueue.html index bd8c5e3..afb363f 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/InMemoryQueue.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/InMemoryQueue.html @@ -6,9 +6,9 @@ - + InMemoryQueue (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/Publisher.html b/docs/html5/groovydoc/com/github/lookout/whoas/Publisher.html index 3b6ee71..00829f6 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/Publisher.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/Publisher.html @@ -6,9 +6,9 @@ - + Publisher (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/RedisQueue.html b/docs/html5/groovydoc/com/github/lookout/whoas/RedisQueue.html index aab19fb..9971241 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/RedisQueue.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/RedisQueue.html @@ -6,9 +6,9 @@ - + RedisQueue (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/SequentialHookRunner.html b/docs/html5/groovydoc/com/github/lookout/whoas/SequentialHookRunner.html index 4458086..846f4c6 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/SequentialHookRunner.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/SequentialHookRunner.html @@ -6,9 +6,9 @@ - + SequentialHookRunner (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/WhoasConfiguration.html b/docs/html5/groovydoc/com/github/lookout/whoas/WhoasConfiguration.html index 0824ca7..b465cee 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/WhoasConfiguration.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/WhoasConfiguration.html @@ -6,9 +6,9 @@ - + WhoasConfiguration (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/WhoasFactory.html b/docs/html5/groovydoc/com/github/lookout/whoas/WhoasFactory.html index a815e8c..741dc5a 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/WhoasFactory.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/WhoasFactory.html @@ -6,9 +6,9 @@ - + WhoasFactory (whoas 0.1.4 API) - + @@ -203,7 +203,7 @@ if (location.href.indexOf('is-external=true') == -1) { diff --git a/docs/html5/groovydoc/com/github/lookout/whoas/WhoasQueueConfig.html b/docs/html5/groovydoc/com/github/lookout/whoas/WhoasQueueConfig.html index b4505e9..ee34529 100644 --- a/docs/html5/groovydoc/com/github/lookout/whoas/WhoasQueueConfig.html +++ b/docs/html5/groovydoc/com/github/lookout/whoas/WhoasQueueConfig.html @@ -6,9 +6,9 @@ - + WhoasQueueConfig (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/deprecated-list.html b/docs/html5/groovydoc/deprecated-list.html index 8f9e597..e4ca5dc 100644 --- a/docs/html5/groovydoc/deprecated-list.html +++ b/docs/html5/groovydoc/deprecated-list.html @@ -5,7 +5,7 @@ Deprecated API (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/help-doc.html b/docs/html5/groovydoc/help-doc.html index 47bc0a7..21fb41b 100644 --- a/docs/html5/groovydoc/help-doc.html +++ b/docs/html5/groovydoc/help-doc.html @@ -8,7 +8,7 @@ API Help (whoas 0.1.4 API) - + diff --git a/docs/html5/groovydoc/index-all.html b/docs/html5/groovydoc/index-all.html index b1d8f9a..fda3013 100644 --- a/docs/html5/groovydoc/index-all.html +++ b/docs/html5/groovydoc/index-all.html @@ -5,7 +5,7 @@ Index (whoas 0.1.4 API) - + diff --git a/docs/html5/index.html b/docs/html5/index.html index df96ff7..d931dbd 100644 --- a/docs/html5/index.html +++ b/docs/html5/index.html @@ -566,7 +566,7 @@ the server-side component, i.e. a "webhook publisher."

diff --git a/docs/html5/publisher.html b/docs/html5/publisher.html index 3a4abac..1d305dd 100644 --- a/docs/html5/publisher.html +++ b/docs/html5/publisher.html @@ -581,7 +581,7 @@ request

diff --git a/src/asciidoc/configuration.ad b/src/asciidoc/configuration.ad index a4095a0..695e8d3 100644 --- a/src/asciidoc/configuration.ad +++ b/src/asciidoc/configuration.ad @@ -11,10 +11,18 @@ Library Configuration The clients of whoas library can add "whoas" configuration to build queue and runner of their choice. See the example below +* queue: configure type and queue specific parameters +** type: full classname for the queue class defined in whoas (e.g. com.github.lookout.whoas.InMemoryQueue) +** key: key of the list data type (currently applies to redis) +** hostname: hostname of the distributed queue server (currently applies to redis) +** port: port of the distributed queue server (currently applies to redis) +* runnerType: full classname for the runner class defined in whoas + ---- whoas: queue: type: "com.github.lookout.whoas.RedisQueue" + key: "queue" hostname: "localhost" port: 6379 runnerType: "com.github.lookout.whoas.SequentialHookRunner" diff --git a/src/main/groovy/com/github/lookout/whoas/AbstractHookQueue.groovy b/src/main/groovy/com/github/lookout/whoas/AbstractHookQueue.groovy index b1e6d3d..6879c85 100644 --- a/src/main/groovy/com/github/lookout/whoas/AbstractHookQueue.groovy +++ b/src/main/groovy/com/github/lookout/whoas/AbstractHookQueue.groovy @@ -30,7 +30,6 @@ abstract class AbstractHookQueue { */ abstract Long getSize() - /** * */ diff --git a/src/main/groovy/com/github/lookout/whoas/Publisher.groovy b/src/main/groovy/com/github/lookout/whoas/Publisher.groovy index c905a1f..60e7e33 100644 --- a/src/main/groovy/com/github/lookout/whoas/Publisher.groovy +++ b/src/main/groovy/com/github/lookout/whoas/Publisher.groovy @@ -7,6 +7,7 @@ import javax.ws.rs.client.Invocation import javax.ws.rs.core.Response import javax.ws.rs.ProcessingException + /** * Publisher is the class responsible for implementing the *actual* HTTP * request logic for Whoas @@ -40,6 +41,7 @@ class Publisher { Invocation inv = buildInvocationFrom(request) try { response = inv.invoke() + /* LOG: response */ String responseBody = response.readEntity(String.class) } @@ -66,6 +68,10 @@ class Publisher { * Determine whether this response meets our criteria for retry */ Boolean shouldRetry(Response response) { + if (response == null) { + return true + } + /* Enhance your calm and try again */ if (response.status == 420) { return true diff --git a/src/main/groovy/com/github/lookout/whoas/WhoasFactory.groovy b/src/main/groovy/com/github/lookout/whoas/WhoasFactory.groovy index 2760951..df55a5c 100644 --- a/src/main/groovy/com/github/lookout/whoas/WhoasFactory.groovy +++ b/src/main/groovy/com/github/lookout/whoas/WhoasFactory.groovy @@ -13,7 +13,7 @@ public class WhoasFactory { /** * Queue configuration */ - @JsonProperty + @JsonProperty(value = "queue") WhoasQueueConfig queueConfig = new WhoasQueueConfig() /**