Search in sources :

Example 1 with MQClientInstanceGetter

use of com.navercorp.pinpoint.plugin.rocketmq.field.accessor.MQClientInstanceGetter in project pinpoint by naver.

the class DefaultMQPushConsumerImplStartInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    DefaultMQPushConsumerImpl consumerImpl = (DefaultMQPushConsumerImpl) target;
    MessageListener messageListener = consumerImpl.getDefaultMQPushConsumer().getMessageListener();
    MQClientInstanceGetter mqClientInstanceGetter = (MQClientInstanceGetter) target;
    MQClientInstance mqClientInstance = mqClientInstanceGetter._$PINPOINT$_getMQClientInstance();
    RemotingClient remotingClient = mqClientInstance.getMQClientAPIImpl().getRemotingClient();
    if (remotingClient instanceof NettyRemotingClient) {
        ChannelTablesGetter nettyRemotingClient = (ChannelTablesGetter) remotingClient;
        ChannelTablesAccessor channelTablesAccessor = (ChannelTablesAccessor) messageListener;
        channelTablesAccessor._$PINPOINT$_setChannelTables(nettyRemotingClient._$PINPOINT$_getChannelTables());
    }
}
Also used : DefaultMQPushConsumerImpl(org.apache.rocketmq.client.impl.consumer.DefaultMQPushConsumerImpl) NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient) RemotingClient(org.apache.rocketmq.remoting.RemotingClient) MQClientInstanceGetter(com.navercorp.pinpoint.plugin.rocketmq.field.accessor.MQClientInstanceGetter) ChannelTablesAccessor(com.navercorp.pinpoint.plugin.rocketmq.field.accessor.ChannelTablesAccessor) ChannelTablesGetter(com.navercorp.pinpoint.plugin.rocketmq.field.accessor.ChannelTablesGetter) MessageListener(org.apache.rocketmq.client.consumer.listener.MessageListener) NettyRemotingClient(org.apache.rocketmq.remoting.netty.NettyRemotingClient) MQClientInstance(org.apache.rocketmq.client.impl.factory.MQClientInstance)

Aggregations

ChannelTablesAccessor (com.navercorp.pinpoint.plugin.rocketmq.field.accessor.ChannelTablesAccessor)1 ChannelTablesGetter (com.navercorp.pinpoint.plugin.rocketmq.field.accessor.ChannelTablesGetter)1 MQClientInstanceGetter (com.navercorp.pinpoint.plugin.rocketmq.field.accessor.MQClientInstanceGetter)1 MessageListener (org.apache.rocketmq.client.consumer.listener.MessageListener)1 DefaultMQPushConsumerImpl (org.apache.rocketmq.client.impl.consumer.DefaultMQPushConsumerImpl)1 MQClientInstance (org.apache.rocketmq.client.impl.factory.MQClientInstance)1 RemotingClient (org.apache.rocketmq.remoting.RemotingClient)1 NettyRemotingClient (org.apache.rocketmq.remoting.netty.NettyRemotingClient)1