use of org.apache.rocketmq.remoting.netty.NettyRemotingClient in project rocketmq by apache.
the class RequestHeader method createRemotingClient.
public static RemotingClient createRemotingClient(NettyClientConfig nettyClientConfig) {
RemotingClient client = new NettyRemotingClient(nettyClientConfig);
client.start();
return client;
}
use of org.apache.rocketmq.remoting.netty.NettyRemotingClient in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class RequestHeader method createRemotingClient.
public static RemotingClient createRemotingClient() {
NettyClientConfig config = new NettyClientConfig();
RemotingClient client = new NettyRemotingClient(config);
client.start();
return client;
}
use of org.apache.rocketmq.remoting.netty.NettyRemotingClient in project rocketmq by apache.
the class DefaultMQProducerTest method testSetCallbackExecutor.
@Test
public void testSetCallbackExecutor() throws MQClientException {
String producerGroupTemp = producerGroupPrefix + System.currentTimeMillis();
producer = new DefaultMQProducer(producerGroupTemp);
producer.setNamesrvAddr("127.0.0.1:9876");
producer.start();
ExecutorService customized = Executors.newCachedThreadPool();
producer.setCallbackExecutor(customized);
NettyRemotingClient remotingClient = (NettyRemotingClient) producer.getDefaultMQProducerImpl().getmQClientFactory().getMQClientAPIImpl().getRemotingClient();
assertThat(remotingClient.getCallbackExecutor()).isEqualTo(customized);
}
Aggregations