问题
Sample aggregator:
<int:aggregator
input-channel="msgInput"
output-channel="msgOutput"
expire-groups-upon-completion="true"
group-timeout="1000"
expire-groups-upon-timeout="true"
send-partial-result-on-expiry="false"
ref="msgGroup"
/>
With sequence size of 2, when I manually iterate the timestamp of each messages grouped with msgGroup, there are still some (not all) messages that is more than 1000ms difference. Is there anything that I missed perhaps?
Please note that the correlation ID and sequence number is set programmatically based on the payload. Hence, some messages could have same correlationID with sequence number.
回答1:
I suggest you turn on debug logging and follow the message flows.
I am not sure what you mean by "manually iterate the timestamp". Group timeout has nothing to do with message timestamps; it's based on message arrival time (i.e. last group update time).
来源:https://stackoverflow.com/questions/30421220/group-timeout-does-not-work-as-expected-in-spring-aggregator