Catch exceptions that consumers throw

As exceptions that are thrown by consumers are considered to
originate from the application, they cause a closure of the channel
that the consumers use. Neither channel nor consumer are recreated.
As consumers may still be able to process other events, we should
not close the channels due to exceptions. Instead warn, log the
exception and continue.

Change-Id: If4e85412af324568ef6ab5162e692529473298da
diff --git a/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/message/BrokerApiSubscribers.java b/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/message/BrokerApiSubscribers.java
index ac4a972..ed80334 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/message/BrokerApiSubscribers.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/rabbitmq/message/BrokerApiSubscribers.java
@@ -77,7 +77,13 @@
                   topic, messageBody);
               Event event = deserializeWithRetry(messageBody);
               if (event.type != null) {
-                topicSubscriber.consumer().accept(event);
+                try {
+                  topicSubscriber.consumer().accept(event);
+                } catch (Exception e) {
+                  logger.atWarning().withCause(e).log(
+                      "Consumer listening on topic %s threw an exception for data: %s",
+                      topic, messageBody);
+                }
               } else {
                 logger.atFine().log("Event does not have a type, ignoring Event");
               }