Search in sources :

Example 1 with NettyRemotingClient

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;
}
Also used : NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient) NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient)

Example 2 with NettyRemotingClient

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;
}
Also used : NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient) NettyClientConfig(org.apache.rocketmq.remoting.netty.NettyClientConfig) NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient)

Example 3 with NettyRemotingClient

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);
}
Also used : ExecutorService(java.util.concurrent.ExecutorService) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient) Test(org.junit.Test)

Aggregations

NettyRemotingClient (org.apache.rocketmq.remoting.netty.NettyRemotingClient)3 ExecutorService (java.util.concurrent.ExecutorService)1 NettyClientConfig (org.apache.rocketmq.remoting.netty.NettyClientConfig)1 Test (org.junit.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1