Spring集成任务执行程序内存泄漏

时间:2015-11-20 07:34:16

标签: spring-integration

我的模块是Spring集成,它将消息发送到RabbitMQ。

<task:executor id="bulkChannelExecutor" keep-alive="50" poolsize="50-100" queue-capacity="500"
></task:executor>   
    <int:channel id="logIngesterRestEndpointBulk"   >      
        <int:dispatcher task-executor="bulkChannelExecutor" failover="false" /> 
    </int:channel>

While Load testing ist not able to handle heavy loads(100 concurrent users) it causing message or request lost ,if i remove pool-size ,having unbounded poolsize its able to handling heavy loads but its creating memory thread leaks?

Rest Gateway将以Json的形式输入并将其传递给Filter,然后将其传递给 链,有Json消息将被解析和拆分为单独的消息,然后将推送到RabbitMQ

<task:executor id="bulkChannelExecutor" keep-alive="50" pool-size="100-500"
    queue-capacity="500"
></task:executor>   
<int:channel id="logIngesterRestEndpointBulk"   >      
    <int:dispatcher task-executor="bulkChannelExecutor" failover="false" />  
</int:channel>
<int-http:inbound-gateway id="logIngesterGatewayBulk" auto-startup="true" 
    supported-methods="POST" request-channel="logIngesterRestEndpointBulk" 
    path="/rest/log/bulk" error-channel="errorChannel"  reply-timeout="50" 
    request-payload-type="java.lang.String">        
</int-http:inbound-gateway>
<int:channel id="filterChannelbulk">        
</int:channel>
<int:channel id="messageOutputChannel" >       
 </int:channel> 
<int:filter input-channel="logIngesterRestEndpointBulk"
    throw-exception-on-rejection="true" method="validate" ref="payloadValidation"
    output-channel="filterChannelbulk">
</int:filter>
 <int:chain input-channel="filterChannelbulk" output-channel="messageOutputChannel" id="chaining"  >
    <int:splitter id="splitter" ref="payloadSplitter" method="splitPayLoad"  >          
    </int:splitter>
    <int:transformer id="logMessageTransformerbulk" ref="logMessageHeaderTransformer"
        method="transform">
    </int:transformer>
</int:chain>
<int:service-activator input-channel="errorChannel"
    ref="responseHandler" method="handleFailedPayLoad"  >   
</int:service-activator>    
<!-- Start RabbitMQ Configuration -->
 <int:channel id="ackchannel">
</int:channel>
<int-amqp:outbound-channel-adapter  
    id="amqpAdapter" channel="messageOutputChannel" amqp-template="amqpTemplate" lazy-connect="false" confirm-ack-channel="ackchannel"  confirm-correlation-expression="headers['amqp_publishConfirm']"     
    exchange-name="dhp_exchange" routing-key-expression="headers['routingKey']" >  
</int-amqp:outbound-channel-adapter>

<int:service-activator  id="ackservice" input-channel="ackchannel"  ref="responseHandler" method="confirmAck" />

1 个答案:

答案 0 :(得分:0)

由于您使用的是HTTP,因此应删除任务执行程序并允许Web容器管理线程。如果您需要更多线程,请通过Web容器配置执行此操作;不要在这里使用线程切换;它真的没有任何意义,可能导致你描述的问题。