轴突框架:在现有应用程序中将Xstream序列化事件转换为Jackson Serializer

发布于 2025-02-03 08:32:34 字数 138 浏览 2 评论 0原文

我们有一个使用Axon框架编写的应用程序。基于我们与Xstream所面临的问题,已经提出了转换为Jackson Serializer的想法。

是否可以使用Axon中的配置选项将事件存储中的当前事件转换为JSON表示形式,或者我们必须手动处理此内容?

We have an application that was written using the Axon Framework. Based on the issues we are having with XStream, the idea of converting to the Jackson serializer has been proposed.

Is it possible to convert the current events in the event store to a JSON representation using configuration options in Axon or are we going to have to handle this manually?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

z祗昰~ 2025-02-10 08:32:34

轴突框架或任何扩展名提供了实现这一目标的东西。
重写事件商店的最直接方法是编写一个基本的事件处理应用程序,该应用程序从商店中读取,并写(带有所需的调整)来存储两个。

从努力的角度来看,这就是这样的:

  • 构建基本的轴突框架应用程序,从当前XML商店读取。
  • 从Axon的Configurer中分别在应用程序中配置第二个EventStore。该第二个商店的EventStorageEngine应接收JackSonSerializer,而默认商店应使用xstreamSerialializer
  • 编写所有事件,使时间戳(非常重要)完整。该处理程序应将事件“附加”到两个商店。
  • 启动应用程序。默认流媒体事件处理器将阅读所有内容,将其提供给您的活动处理程序,并将其提供给第二家商店。

Axon Framework, nor any of the extensions, provide something out of the box to achieve this.
The most straightforward way to rewrite an event store is to write a basic event handling application that reads from store one and writes (with the desired adjustments) to store two.

From an effort perspective, that's something like this:

  • Construct basic Axon Framework application, reading from current XML store.
  • Configure the second EventStore in your application separately from Axon's Configurer. This second store's EventStorageEngine should receive the JacksonSerializer, whereas the default store should use the XStreamSerializer
  • Write an event handler that handles all events, keeping things like the timestamp (very important) intact. This handler should 'append' events into store two.
  • Start the application. The default Streaming Event Processor will read everything, give it to your Event Handler, that'll provide them to the second store.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文