Giter VIP home page Giter VIP logo

Comments (4)

skyesx avatar skyesx commented on June 11, 2024

easytransaction自身暂不支持,

除非使用底层rpc框架的filter自行实现(如restTemplate的interceptor),但这种实现不不能跨rpc框架使用(不能无缝切换到dubbo)

如果着急可以在EasyTransaction底层使用的restTemplate加入interceptor

不着急可以等到周末,我这边提供/暴露一个EasyTransaction层级的header修改方案

from easytransaction.

soedev avatar soedev commented on June 11, 2024

谢谢,不着急,我们这边还在熟悉框架中,如果补偿的时候,出现异常,存在未处理完成的事务,框架是否提供接口重试

from easytransaction.

skyesx avatar skyesx commented on June 11, 2024

框架自动会重试,但要手工重试的话(用于测试等场景、或者用于界面手动触发重试),可以参考 https://github.com/QNJR-GROUP/EasyTransaction/blob/master/easytrans-starter/src/test/java/com/yiqiniu/easytrans/test/FullTest.java 这里的一段代码,如下

	List<LogCollection> unfinishedLogs = logReader.getUnfinishedLogs(null, 100, new Date());
	for (LogCollection logCollection : unfinishedLogs) {
		guardian.process(logCollection);
	}

from easytransaction.

skyesx avatar skyesx commented on June 11, 2024

后来考虑了下,没有做成一个EasyTrans层次的Header配置,主要是因为不同底层RPC框架传输header形式不太一致,即使统一了也不见得能带来好处,因此只提供了修改 RestRibbon 下HttpHeader的方式,可以在SPRING中注入,EasyTransRpcConsumer,并强制转换为 RestRibbonEasyTransRpcConsumerImpl,这样可以调用方法

RestTemplate getLoadBalancedRestTemplate()

然后可以通过RestTemplate的interceptors来调整header

from easytransaction.

Related Issues (20)

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.