use of co.cask.cdap.messaging.client.ClientMessagingService in project cdap by caskdata.
the class MessagingHttpServiceTest method init.
@BeforeClass
public static void init() throws IOException {
cConf = CConfiguration.create();
cConf.set(Constants.CFG_LOCAL_DATA_DIR, TEMP_FOLDER.newFolder().getAbsolutePath());
cConf.setInt(Constants.MessagingSystem.HTTP_SERVER_CONSUME_CHUNK_SIZE, 128);
// Set max life time to a high value so that dummy tx ids that we create in the tests still work
cConf.setLong(TxConstants.Manager.CFG_TX_MAX_LIFETIME, 10000000000L);
Injector injector = Guice.createInjector(new ConfigModule(cConf), new DiscoveryRuntimeModule().getInMemoryModules(), new MessagingServerRuntimeModule().getInMemoryModules(), new AbstractModule() {
@Override
protected void configure() {
bind(MetricsCollectionService.class).toInstance(new NoOpMetricsCollectionService());
}
});
httpService = injector.getInstance(MessagingHttpService.class);
httpService.startAndWait();
client = new ClientMessagingService(injector.getInstance(DiscoveryServiceClient.class));
}
Aggregations