libin0813306 commented on issue #5851: URL: https://github.com/apache/incubator-seata/issues/5851#issuecomment-2537968237
> 的确现在不支持分支事务的监听机制,不过我这边采用了另外一种方式实现该功能,就是就是通过SPI机制扩展AbstractRMHandler ,在这里能收到分支事务的通知消息,通过rollback和commit事件来监听分支事务状态,实现自己的业务逻辑。 不过有个问题是初始化的时候seata内置的 RMHandlerAT 会在自定义的RMHandlerAT 之后进行加载,从而导致内置的RMHandlerAT 会把自定义的覆盖,所以我不得不把内置的RMHandlerAT 删除,得到一个自己的jar从而实现我的预期想法。 @slievrly 通过SPI机制扩展AbstractRMHandler后可以在自定义的CustomRMHandler类上加@LoadLevel注解,将自定义CustomRMHandler类加载顺序设置大一些,就可以确保自定义CustomRMHandler类在最后加载,就能覆盖掉原生的AbstractRMHandler类,最终分支事务提交或回滚就可以走我们自定义的代码逻辑了。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org