博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
dubbo什么时候会清除Attachments内容
阅读量:4106 次
发布时间:2019-05-25

本文共 584 字,大约阅读时间需要 1 分钟。

@Activate(group = Constants.CONSUMER, order = -10000)
public class ConsumerContextFilter implements Filter {
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        RpcContext.getContext()
                .setInvoker(invoker)
                .setInvocation(invocation)
                .setLocalAddress(NetUtils.getLocalHost(), 0)
                .setRemoteAddress(invoker.getUrl().getHost(),
                        invoker.getUrl().getPort());
        if (invocation instanceof RpcInvocation) {
            ((RpcInvocation) invocation).setInvoker(invoker);
        }
        try {
            return invoker.invoke(invocation);
        } finally {
            RpcContext.getContext().clearAttachments();
        }
    }
}

转载地址:http://htnsi.baihongyu.com/

你可能感兴趣的文章
嵌入式linux软件开发学习笔记--uboot介绍
查看>>
C/C++面试题总结(2)
查看>>
QEMU搭建arm Linux开发环境
查看>>
C语言嵌入式--数据存储与指针笔记6
查看>>
IMX6相关资料归档
查看>>
wireshark笔记
查看>>
arm linux kernel编译问题总结
查看>>
qemu模拟开发板问题记录
查看>>
virtualBOX + ubuntu 与 windows共享文件夹
查看>>
linux qt编译安装问题解决记录
查看>>
samba配置实现linux和windows共享数据
查看>>
linux 嵌入式软件调试技巧
查看>>
git托管代码问题定位解决
查看>>
TCP IP网络编程 问题定位记录
查看>>
openwrt
查看>>
vim配置
查看>>
u-boot/lib/vsprintf.c中学习的编程技巧总结
查看>>
迅为4412开发板sqlite3移植
查看>>
开源库安装问题总结
查看>>
【python实战】爬取起点中文网自制小说阅读器
查看>>