use of org.collectd.protocol.Dispatcher in project metrics by dropwizard.
the class Receiver method before.
@Override
protected void before() throws Throwable {
receiver = new UdpReceiver(new Dispatcher() {
@Override
public void dispatch(ValueList values) {
queue.offer(new ValueList(values));
}
@Override
public void dispatch(Notification notification) {
throw new UnsupportedOperationException();
}
});
receiver.setPort(port);
new Thread(() -> {
try {
receiver.listen();
} catch (Exception e) {
e.printStackTrace();
}
}).start();
}
Aggregations