首页 > 解决方案 > 出站组件的消息历史记录

问题描述

我应该如何跟踪 int-http:outbound-gateway 和 int-jms:outbound-channel-adapter?下面是java类对应的组件的映射。请核实。我需要在以下 bean 上调用 setShouldTrack(true) 方法,以便我可以在消息历史记录中获取这些组件详细信息(名称、类型、时间戳)

    int-ws:outbound-gateway                 org.springframework.integration.ws.MarshallingWebServiceOutboundGateway 
    int-http:inbound-gateway                org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway
    int-http:outbound-gateway               org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler
    int-jms:message-driven-channel-adapter  org.springframework.integration.jms.JmsSendingMessageHandler 
    int-jms:outbound-channel-adapter        ??

目前我能够跟踪 int-http:inbound-gateway 和 int-jms:message-driven-channel-adapter。

标签: spring-integration

解决方案


你的问题不清楚。框架中的所有MessageHandler实现都是 的扩展,AbstractMessageHandler并且有一个setShouldTrack()方法。

如果您想手动调用它,您可以通过他们的id. 这是包装消费者端点和.handler后缀的组合ID:https ://docs.spring.io/spring-integration/docs/current/reference/html/overview.html#endpoint-bean-names

另一方面,如果<message-history>允许我们为用逗号分隔的组件名称配置模式,则不清楚为什么要手动执行此操作:https ://docs.spring.io/spring-integration/docs/current/reference/ html/system-management-chapter.html#message-history-config


推荐阅读