ApplicationContext context = new ClassPathXmlApplicationContext("resequencer-config.xml", ResequencerDemo.class);
MessageChannel inputChannel = context.getBean("inputChannel", MessageChannel.class);
inputChannel.send(MessageBuilder.withPayload(5).setCorrelationId(1).setSequenceNumber(5).build());
inputChannel.send(MessageBuilder.withPayload(2).setCorrelationId(1).setSequenceNumber(2).build());
inputChannel.send(MessageBuilder.withPayload(1).setCorrelationId(1).setSequenceNumber(1).build());
inputChannel.send(MessageBuilder.withPayload(2).setCorrelationId(2).setSequenceNumber(2).build());
inputChannel.send(MessageBuilder.withPayload(1).setCorrelationId(2).setSequenceNumber(1).build());
inputChannel.send(MessageBuilder.withPayload(4).setCorrelationId(1).setSequenceNumber(4).build());