轴突事件处理程序不在不同的微服务上工作

发布于 2025-01-17 16:44:12 字数 377 浏览 4 评论 0原文

我正在使用 Axon 框架实现事件驱动的 CQRS 概念。我创建了两个独立的微服务和它们自己的两个写入和读取数据库。

我正在 ms-1 中发布一个事件,现在我想在 ms-2 中处理该事件,以便我可以将其保留在我的读取数据库中。但 @EventHandler 在我的 ms-2 中不起作用。事件发布在 AxonServer 上,我可以在那里看到更新。

是的,我在 ms-2 中的 EventHandler 类上确实有 @Component。另外,我在 docker 上运行 AxonServer。

当 @EventHandler 位于同一个微服务中时,它可以正常工作。

我的 axon-framework 依赖项是 4.5.8,google guava 的依赖项是 30.1.1-jre

I was implementing event-driven CQRS concept using Axon framework. I created two separate microservices and their own two write and read databases.

I am publishing an event in ms-1 and now I want to handle that event in ms-2, so that I can persist it in my read DB. But the @EventHandler is not working in my ms-2. The events are published on the AxonServer, I can see the updates there.

And yes, I do have @Component on the EventHandler class in ms-2. Also, I am running AxonServer on docker.

The @EventHandler works fine when it is in the same microservice.

My axon-framework dependency is 4.5.8 and google guava's is 30.1.1-jre

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文