How to stop application , close Connection after reading 1000 messages in Spring Integration from a queue.
I have used Message operation = (Message)MessageBuilder.withPayload("@servAct.stop()").build(); but this stops the channel, not the whole connection and application .