与MongoDB队列的Spring集成:丢失的自定义标题

问题描述 投票:0回答:1

我有一个Spring Integration App,用于向MongoDB队列发送消息或从MongoDB队列接收消息,除了消息头,它在我使用的发送者处都可以正常工作。

Message<PolicyEvent> message = MessageBuilder
                .withPayload(myPayload)
                .setHeader("someHeader", "some value")
                .build();
messageGateway.sendEventMessage(message);

当应用程序收到消息时,唯一的标头是默认值(id,spanId,时间等)。

尽管我在网上搜索(文档,Stackoverflow等),但仍无法弄清为什么自定义标头丢失了。我的配置是:

  • Spring-boot-2.2.3.RELEASE
  • Mongodb 4.0.3社区
  • [所有配置(包括集成)都是Java注释(无xml)。
spring-integration spring-data-mongodb
1个回答
0
投票
我只是看过代码,而mongo端点当前不支持标头;我没有意识到这一点;随时在GitHub问题中打开新功能请求。
© www.soinside.com 2019 - 2024. All rights reserved.