factory.setTransactionManager(new ResourcelessTransactionManager());
factory.setBeanName("step");
factory.setItemWriter(writer);
factory.setCommitInterval(4);
MessagingTemplate gateway = new MessagingTemplate();
writer.setMessagingOperations(gateway);
gateway.setDefaultChannel(requests);
writer.setReplyChannel(replies);
gateway.setReceiveTimeout(100);
TestItemWriter.count = 0;
// Drain queues
Message<?> message = replies.receive(10);