GithubHelp home page GithubHelp logo

nepxion / discoveryagent Goto Github PK

View Code? Open in Web Editor NEW
53.0 5.0 29.0 109 KB

☀️ Nepxion Discovery Agent is a java agent to resolve loss of ThreadLocal in cross-thread scenario, such as Spring Async、Hystrix Thread、Runnable、Callable、Single Thread、Thread Pool、MDC 异步跨线程Agent

Home Page: http://www.nepxion.com

License: Apache License 2.0

Java 98.85% Batchfile 1.15%
java-agent async cross-thread thread-pool spring-async hystrix single-thread

discoveryagent's Introduction

Discovery【探索】云原生微服务解决方案

Total visits Total lines License Maven Central Javadocs Build Status Codacy Badge Stars Stars

Wiki Wiki Discovery PPT Discovery Page Discovery Platform Page Polaris Page

           

如果您觉得本框架具有一定的参考价值和借鉴意义,请帮忙在页面右上角 [Star]

简介

作者简介

  • Nepxion开源社区创始人
  • 2020年阿里巴巴**云原生峰会出品人
  • 2020年被Nacos和Spring Cloud Alibaba纳入相关开源项目
  • 2021年阿里巴巴技术峰会上海站演讲嘉宾
  • 2021年荣获陆奇博士主持的奇绩资本,进行风险投资的关注和调研
  • 2021年入选Gitee最有价值开源项目
  • 阿里巴巴官方书籍《Nacos架构与原理》作者之一
  • Spring Cloud Alibaba Steering Committer、Nacos Group Member
  • Spring Cloud Alibaba、Nacos、Sentinel、OpenTracing Committer & Contributor

商业合作

① Discovery系列

框架名称 框架版本 支持Spring Cloud版本 使用许可
Discovery 1.x.x ~ 6.x.x Camden ~ Hoxton 开源,永久免费
DiscoveryX 7.x.x ~ 10.x.x 2020 ~ 2023 闭源,商业许可

② Polaris系列

Polaris为Discovery高级定制版,特色功能

  • 基于Nepxion Discovery集成定制
  • 多云、多活、多机房流量调配
  • 跨云动态域名、跨环境适配
  • DCN、DSU、SET单元化部署
  • 组件灵活装配、配置对外屏蔽
  • 极简低代码PaaS平台
框架名称 框架版本 支持Discovery版本 支持Spring Cloud版本 使用许可
Polaris 1.x.x 6.x.x Finchley ~ Hoxton 闭源,商业许可
Polaris 2.x.x 7.x.x ~ 10.x.x 2020 ~ 2023 闭源,商业许可

有商业版需求的企业和用户,请添加微信1394997,联系作者,洽谈合作事宜

入门资料

Discovery【探索】企业级云原生微服务开源解决方案

① 快速入门

② 解决方案

③ 最佳实践

④ 平台界面

⑤ 框架源码

⑥ 指南示例源码

⑦ 指南示例说明

Polaris【北极星】企业级云原生微服务商业解决方案

① 解决方案

② 框架源码

③ 指南示例源码

④ 指南示例说明

  • Spring Cloud Finchley ~ Hoxton版本
  • Spring Cloud 202x版本

请联系我

微信、钉钉、公众号和文档

Star走势图

Stargazers over time

discoveryagent's People

Contributors

haojunren avatar zifeihan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

discoveryagent's Issues

Collections.emptyList()使用不当问题

代码地址:com/nepxion/discovery/agent/plugin/thread/ThreadPlugin.java:55 会出现问题
image

List<String> basePackages = StringUtil.tokenizeToStringList(baseThreadScanPackages, ThreadConstant.THREAD_SCAN_PACKAGES_DELIMITERS); List<String> customPackages = StringUtil.tokenizeToStringList(threadScanPackages, ThreadConstant.THREAD_SCAN_PACKAGES_DELIMITERS); basePackages.addAll(customPackages);
若是basePackages为emptyList,则后面的不能再用emptyList添加东西了 basePackages.addAll(customPackages);
image
这行可能是一个失误吧,建议删除这行代码。

ThreadLocalHook注册bug

ThreadPlugin中调用了所有ThreadLocalHook接口(需注册)中的create、before等方法, ThreadLocalHook的注册是在插件(比如DiscoveryServicePlugin)匹配到并执行对应的TransformCallback的doInTransform方法.
当项目启动时发起的第一个灰度请求是异步时

image

image
此时Task构造器先被增强,然而因为Task构造时RestStrategyContext尚未加载, 所以DiscoveryServicePlugin对应的ThreadLocalHook还未注册,Object[] objects = ThreadLocalCopier.create(), 此行代码objects结果为空, 灰度结果会异常.
然后随着灰度代码的执行, 会加载到RestStrategyContext, 然后会执行DiscoveryServicePlugin的TransformCallback的doInTransform方法, 对应的ThreadLocalHook将被注册.
下次异步调用时灰度结果正常.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.