我正在努力加速Spring Integration聚合器组件,因为它每秒释放一次完整的消息组,我需要它更快。
spring.xml片段:
<int:channel id="fromRabbit">
<int:queue capacity="4096"/>
</int:channel>
<int-amqp:inbound-channel-adapter channel="fromRabbit" queue-names="si.test.queue"
connection-factory="connectionFactory"
concurrent-consumers="5"
task-executor="myExecutor"/>
<bean id="aggregatorBean" class="ResponseAggregator" />
<bean id="correlationBean" class="CustomCorrelationStrategy"/>
<bean id="releaseBean" class="org.springframework.integration.aggregator.TimeoutCountSequenceSizeReleaseStrategy">
<constructor-arg value="${gcmPollSize}"/>
<constructor-arg value="60000"/>
</bean>
<int:aggregator id="myAggregator"
auto-startup="true"
input-channel="fromRabbit"
output-channel="completeChannel"
group-timeout="10000"
message-store="responseMessageStore"
send-partial-result-on-expiry="true"
send-timeout="100"
ref="aggregatorBean"
correlation-strategy="correlationBean"
release-strategy="releaseBean"
method="handle">
</int:aggregator>
<int:channel id="completeChannel">
<int:queue capacity="4096"/>
</int:channel>
<bean id="pl" class="CompleteChannelPoller"/>
<int:outbound-channel-adapter channel="completeChannel" ref="pl" method="handle">
</int:outbound-channel-adapter>
<int:poller id="customPoller" task-executor="myExecutor" receive-timeout="0" max-messages-per-poll="1000" fixed-rate="100" default="true"/>
CompleteChannelPoller每秒接收一次消息。我不明白为什么。