有人可以帮助我了解如何在 Springboot 中使用 LRA 协调器配置 Apache Camel Saga。我试过文档,但不幸的是,文档不是那么清楚,我至少需要一些示例代码来了解如何使用特定图像执行此外部协调器。如果有人实施了它,请分享一些文档或专门配置 LRA 的方法。
你用的是什么骆驼版本?你可以像
一样使用
applicaion.yaml
camel:
lra:
enabled: true
coordinator-url: http://localhost:8088
local-participant-url: http://localhost:8080/context-path
在运行外部协调器服务器方面,您可以考虑https://quay.io/repository/jbosstm/lra-coordinator。然后用命令启动它
docker run -i --rm -p 8088:8080 quay.io/jbosstm/lra-coordinator
要验证 lra-coordinator 是否正常工作,请尝试
curl -X POST http://localhost:8088/lra-coordinator/start
它应该返回类似
http://localhost:8088/lra-coordinator/0_ffffac110005_8bf3_640f2093_2
的内容并使用 curl
检索链接,您可以获得当前 LRA 交易状态。