@Aggregator
public Meal prepareMeal(List<Message<Product>> products) {
Recipe recipe = (Recipe) products.get(0).getHeaders().get("recipe");
Meal meal = new Meal(recipe);
for (Message<Product> message : products) {
meal.cook(message.getPayload());
}
return meal;
}
@CorrelationStrategy