aphyr/riemann-java-client — pull request #31 by tcrayford (2014-01-01 18:26:27+00:00)
Title: better error message in queue backwards compatability

I hit this in production recently, and it was somewhat confusing to debug why riemann was sending no events after switching to the batch client. I eventually traced it here, and figured a better error message was in order rather than a client that just silently swallows all events and never sends them.

As a side note, this error case *always* fires for me, and I'm not sure how the code is even meant to work. `.asSubclass` is called to turn `LinkedTransferQueue` into an `AbstractTransferQueue`. As I understand `asSubclass` though, this can't ever work, because `LinkedTransferQueue` is not an `AbstractTransferQueue`. Running the equivalent clojure code:

```clojure
(.asSubclass (Class/forName "java.util.concurrent.LinkedTransferQueue") com.aphyr.riemann.client.AbstractTransferQueue)
```

always throws a class casting exception (at least in this jvm):

jvm info:
```
$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
```