Search in sources :

Example 6 with MisfireException

use of org.graylog2.plugin.inputs.MisfireException in project graylog2-server by Graylog2.

the class UdpTransportTest method launchTransportForBootStrapTest.

private UdpTransport launchTransportForBootStrapTest(final ChannelHandler channelHandler) throws MisfireException {
    final UdpTransport transport = new UdpTransport(CONFIGURATION, throughputCounter, new LocalMetricRegistry()) {

        @Override
        protected LinkedHashMap<String, Callable<? extends ChannelHandler>> getBaseChannelHandlers(MessageInput input) {
            final LinkedHashMap<String, Callable<? extends ChannelHandler>> handlers = new LinkedHashMap<>();
            handlers.put("counter", Callables.returning(channelHandler));
            handlers.putAll(super.getFinalChannelHandlers(input));
            return handlers;
        }
    };
    final MessageInput messageInput = mock(MessageInput.class);
    when(messageInput.getId()).thenReturn("TEST");
    when(messageInput.getName()).thenReturn("TEST");
    transport.launch(messageInput);
    return transport;
}
Also used : MessageInput(org.graylog2.plugin.inputs.MessageInput) ChannelHandler(org.jboss.netty.channel.ChannelHandler) Callable(java.util.concurrent.Callable) LocalMetricRegistry(org.graylog2.plugin.LocalMetricRegistry) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

MisfireException (org.graylog2.plugin.inputs.MisfireException)4 RawMessage (org.graylog2.plugin.journal.RawMessage)3 IOException (java.io.IOException)2 Callable (java.util.concurrent.Callable)2 ChannelHandler (org.jboss.netty.channel.ChannelHandler)2 InstrumentedExecutorService (com.codahale.metrics.InstrumentedExecutorService)1 AbstractExecutionThreadService (com.google.common.util.concurrent.AbstractExecutionThreadService)1 InetSocketAddress (java.net.InetSocketAddress)1 MalformedURLException (java.net.MalformedURLException)1 URL (java.net.URL)1 LinkedHashMap (java.util.LinkedHashMap)1 Properties (java.util.Properties)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ExecutorService (java.util.concurrent.ExecutorService)1 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)1 ConsumerConfig (kafka.consumer.ConsumerConfig)1 ConsumerIterator (kafka.consumer.ConsumerIterator)1 ConsumerTimeoutException (kafka.consumer.ConsumerTimeoutException)1 KafkaStream (kafka.consumer.KafkaStream)1 TopicFilter (kafka.consumer.TopicFilter)1