masterHandler.registerAggregate(corrId, nrOfMessages);
for (int i = 0; i < nrOfMessages; i++) {
WorkMessage workMessage = new WorkMessage();
workMessage.setCorrelationId(corrId);
workMessage.setStart(i);
workMessage.setNrOfElements(nrOfElements);
rabbitTemplate.convertAndSend(workMessage, new MessagePostProcessor() {
public Message postProcessMessage(Message message) throws AmqpException {
message.getMessageProperties().setReplyToAddress(new Address("direct://piExchange/" + QueueNames.RESULT_QUEUE_NAME));
return message;