The problem is you have two distinct subscribers to logger
- the logging adapter and the aggregator.
When there is more than one subscriber to a point-to-point channel, the messages are round-robin distributed to the subscribers, so the aggregator is only going to get every other message.
a1
goes to the logger, a2
goes to the aggregator, a3
to the logger, etc.
Channel adapters that don't specify an input channel subscribe to a channel matching the id
instead.
I didn't notice you had done this in your earlier question.
If you want to log everything going through a channel, add a wire-tap instead.
Alternatively, make logger
a <publish-subscribe-channel/>
instead; that way, both subscribers (logger and aggregator) will get all messages.
As I mentioned in my comments on the other question/answer, if you had looked at DEBUG logging you would have seen messages alternating between the logging handler and the aggregating handler.
As ever, with these kind of problems, DEBUG logging will often make it obvious what's happening.