Search in sources :

Example 1 with HttpServerPipelineFactory

use of com.linkedin.databus2.core.container.netty.HttpServerPipelineFactory in project databus by linkedin.

the class TestRelayCommandsLocal method setUp.

@BeforeMethod
public void setUp() throws Exception {
    // creates an event factory for us
    _relay = new HttpRelay(_staticConfig, null);
    _eventBuffer = _relay.getEventBuffer();
    DatabusEventProducer randomEventProducer = new DatabusEventRandomProducer(_eventBuffer, 10, 1, 10, _staticConfig.getSourceIds(), null, null);
    RequestProcessorRegistry processorRegistry = _relay.getProcessorRegistry();
    processorRegistry.register(EchoRequestProcessor.COMMAND_NAME, new EchoRequestProcessor(null));
    processorRegistry.register(GenerateDataEventsRequestProcessor.COMMAND_NAME, new GenerateDataEventsRequestProcessor(null, _relay, randomEventProducer));
    // Configure the server.
    _bootstrap = new ServerBootstrap(new DefaultLocalServerChannelFactory());
    // Set up the event pipeline factory.
    _bootstrap.setPipelineFactory(new HttpServerPipelineFactory(_relay));
    _serverAddress = new LocalAddress(10);
    _serverChannel = _bootstrap.bind(_serverAddress);
}
Also used : DatabusEventRandomProducer(com.linkedin.databus.core.util.DatabusEventRandomProducer) HttpServerPipelineFactory(com.linkedin.databus2.core.container.netty.HttpServerPipelineFactory) EchoRequestProcessor(com.linkedin.databus2.core.container.request.EchoRequestProcessor) DefaultLocalServerChannelFactory(org.jboss.netty.channel.local.DefaultLocalServerChannelFactory) LocalAddress(org.jboss.netty.channel.local.LocalAddress) RequestProcessorRegistry(com.linkedin.databus2.core.container.request.RequestProcessorRegistry) DatabusEventProducer(com.linkedin.databus.core.util.DatabusEventProducer) GenerateDataEventsRequestProcessor(com.linkedin.databus.container.request.GenerateDataEventsRequestProcessor) ServerBootstrap(org.jboss.netty.bootstrap.ServerBootstrap) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

GenerateDataEventsRequestProcessor (com.linkedin.databus.container.request.GenerateDataEventsRequestProcessor)1 DatabusEventProducer (com.linkedin.databus.core.util.DatabusEventProducer)1 DatabusEventRandomProducer (com.linkedin.databus.core.util.DatabusEventRandomProducer)1 HttpServerPipelineFactory (com.linkedin.databus2.core.container.netty.HttpServerPipelineFactory)1 EchoRequestProcessor (com.linkedin.databus2.core.container.request.EchoRequestProcessor)1 RequestProcessorRegistry (com.linkedin.databus2.core.container.request.RequestProcessorRegistry)1 ServerBootstrap (org.jboss.netty.bootstrap.ServerBootstrap)1 DefaultLocalServerChannelFactory (org.jboss.netty.channel.local.DefaultLocalServerChannelFactory)1 LocalAddress (org.jboss.netty.channel.local.LocalAddress)1 BeforeMethod (org.testng.annotations.BeforeMethod)1