Memory leaks Spring库中的内存泄漏:SimpleMessageStore

Memory leaks Spring库中的内存泄漏:SimpleMessageStore,memory-leaks,spring-integration,Memory Leaks,Spring Integration,我正在开发的3个Web服务使用Spring,SimpleMessageStore来存储消息。由于某种原因,它在生产环境中导致内存泄漏,我无法在较低的环境中复制它。我是spring集成的新手,需要帮助了解可能导致这种情况的原因 spring配置代码如下所示: <!-- MESSAGE STORES --> <bean id="monitoringHeaderRequestMsgStore" class="org.springframework.integration.sto

我正在开发的3个Web服务使用Spring,SimpleMessageStore来存储消息。由于某种原因,它在生产环境中导致内存泄漏,我无法在较低的环境中复制它。我是spring集成的新手,需要帮助了解可能导致这种情况的原因

spring配置代码如下所示:

<!--  MESSAGE STORES -->  
<bean id="monitoringHeaderRequestMsgStore" class="org.springframework.integration.store.SimpleMessageStore"/>
<bean id="gbqHeaderRequestMsgStore" class="org.springframework.integration.store.SimpleMessageStore"/>
<bean id="bondAgreementResponseMsgStore" class="org.springframework.integration.store.SimpleMessageStore"/>
<bean id="bondWIthRulesRequestMsgStore" class="org.springframework.integration.store.SimpleMessageStore"/>

<bean id="ProcessVariableMessageStores" class="com.aviva.uklife.investment.impl.ProcessVariableMessageStores">
    <property name="_monitoringHeaderRequestMsgStore" ref="monitoringHeaderRequestMsgStore"/>
    <property name="_gbqHeaderRequestMsgStore" ref="gbqHeaderRequestMsgStore"/>
    <property name="_bondWIthRulesRequestMsgStore" ref="bondWIthRulesRequestMsgStore"/>
    <property name="_bondAgreementResponseMsgStore" ref="bondAgreementResponseMsgStore"/>
</bean>

<!--  Retrieve stored MonitoringHeaderRequest -->
<int:transformer expression="headers.get('#{T(.....Constants).MONITORING_HEADER_REQUEST_CLAIM_CHECK_ID}')"/>
<int:claim-check-out message-store="monitoringHeaderRequestMsgStore" remove-message="false"/>
<!--  Store HeaderRequest -->
<int:gateway request-channel="header-req-store-channel"/>

<!--  PROCESS VARIABLES STORAGE IN STORE CHANNELS WITH KEY OR CLAIMCHECK ID -->

<int:chain input-channel="monitoring-header-req-store-channel">
    <int:claim-check-in message-store="monitoringHeaderRequestMsgStore"/>
    <int:header-enricher>
        <int:header name="#{T(....Constants).MONITORING_HEADER_REQUEST_CLAIM_CHECK_ID}" expression="payload"/>
    </int:header-enricher>
    <int:claim-check-out message-store="monitoringHeaderRequestMsgStore" remove-message="false"/>
</int:chain> 

谢谢

老实说,不建议在生产环境中使用SimpleMessageStore。正如您所注意到的,这是因为内存泄漏。如果不定期清除MessageStore

对,在某些情况下,您可能需要在MessageStore中长时间保存消息。因此,考虑用一些消息替换简单的Agestor。< /P> 从另一方面来说,我们需要更多的信息来提供更好的帮助


也许您只有几个聚合器,而不使用expire groups on completion=true…

非常感谢您的回复。没有使用聚合器。此外,在spring配置文件中,claim check out transformer上的remove message boolean属性被设置为false,并且MessageStores被编程清除,而不是声明清除。这可能是内存泄漏的原因吗?好吧,请在MSs周围分享你的配置,并指出你是如何处理它们的。从另一方面来说,尝试在应用程序中仅使用单个SimpleMessageStore Bean。配置代码如下: