133.13. 使用 toD
如果您需要发送消息到许多不同的交换,您必须重复使用端点,并使用 toD 指定带有简单语言的动态目的地。
例如,您需要使用顺序类型将信息发送到交换,然后您可以使用 toD
,如下所示:
from("direct:order") .toD("spring-rabbit:order-${header.orderType}");
from("direct:order")
.toD("spring-rabbit:order-${header.orderType}");