use of org.apache.pulsar.broker.service.PulsarChannelInitializer in project pulsar by yahoo.
the class LookupRetryTest method newPulsarService.
@Override
protected PulsarService newPulsarService(ServiceConfiguration conf) throws Exception {
return new PulsarService(conf) {
@Override
protected BrokerService newBrokerService(PulsarService pulsar) throws Exception {
BrokerService broker = new BrokerService(this, ioEventLoopGroup);
broker.setPulsarChannelInitializerFactory((_pulsar, opts) -> {
return new PulsarChannelInitializer(_pulsar, opts) {
@Override
protected ServerCnx newServerCnx(PulsarService pulsar, String listenerName) throws Exception {
connectionsCreated.incrementAndGet();
return new ErrorByTopicServerCnx(pulsar, failureMap);
}
};
});
return broker;
}
};
}
use of org.apache.pulsar.broker.service.PulsarChannelInitializer in project incubator-pulsar by apache.
the class LookupRetryTest method newPulsarService.
@Override
protected PulsarService newPulsarService(ServiceConfiguration conf) throws Exception {
return new PulsarService(conf) {
@Override
protected BrokerService newBrokerService(PulsarService pulsar) throws Exception {
BrokerService broker = new BrokerService(this, ioEventLoopGroup);
broker.setPulsarChannelInitializerFactory((_pulsar, opts) -> {
return new PulsarChannelInitializer(_pulsar, opts) {
@Override
protected ServerCnx newServerCnx(PulsarService pulsar, String listenerName) throws Exception {
connectionsCreated.incrementAndGet();
return new ErrorByTopicServerCnx(pulsar, failureMap);
}
};
});
return broker;
}
};
}
use of org.apache.pulsar.broker.service.PulsarChannelInitializer in project incubator-pulsar by apache.
the class NonDurableSubscriptionTest method newPulsarService.
@Override
protected PulsarService newPulsarService(ServiceConfiguration conf) throws Exception {
return new PulsarService(conf) {
@Override
protected BrokerService newBrokerService(PulsarService pulsar) throws Exception {
BrokerService broker = new BrokerService(this, ioEventLoopGroup);
broker.setPulsarChannelInitializerFactory((_pulsar, opts) -> {
return new PulsarChannelInitializer(_pulsar, opts) {
@Override
protected ServerCnx newServerCnx(PulsarService pulsar, String listenerName) throws Exception {
return new ServerCnx(pulsar) {
@Override
protected void handleFlow(CommandFlow flow) {
super.handleFlow(flow);
numFlow.incrementAndGet();
}
};
}
};
});
return broker;
}
};
}
use of org.apache.pulsar.broker.service.PulsarChannelInitializer in project pulsar by yahoo.
the class NonDurableSubscriptionTest method newPulsarService.
@Override
protected PulsarService newPulsarService(ServiceConfiguration conf) throws Exception {
return new PulsarService(conf) {
@Override
protected BrokerService newBrokerService(PulsarService pulsar) throws Exception {
BrokerService broker = new BrokerService(this, ioEventLoopGroup);
broker.setPulsarChannelInitializerFactory((_pulsar, opts) -> {
return new PulsarChannelInitializer(_pulsar, opts) {
@Override
protected ServerCnx newServerCnx(PulsarService pulsar, String listenerName) throws Exception {
return new ServerCnx(pulsar) {
@Override
protected void handleFlow(CommandFlow flow) {
super.handleFlow(flow);
numFlow.incrementAndGet();
}
};
}
};
});
return broker;
}
};
}
use of org.apache.pulsar.broker.service.PulsarChannelInitializer in project pulsar by apache.
the class NonDurableSubscriptionTest method newPulsarService.
@Override
protected PulsarService newPulsarService(ServiceConfiguration conf) throws Exception {
return new PulsarService(conf) {
@Override
protected BrokerService newBrokerService(PulsarService pulsar) throws Exception {
BrokerService broker = new BrokerService(this, ioEventLoopGroup);
broker.setPulsarChannelInitializerFactory((_pulsar, opts) -> {
return new PulsarChannelInitializer(_pulsar, opts) {
@Override
protected ServerCnx newServerCnx(PulsarService pulsar, String listenerName) throws Exception {
return new ServerCnx(pulsar) {
@Override
protected void handleFlow(CommandFlow flow) {
super.handleFlow(flow);
numFlow.incrementAndGet();
}
};
}
};
});
return broker;
}
};
}
Aggregations