如何從單一 MessageProducer 發送訊息到不同的目的地

 常見問題 > JMS > 如何從單一 MessageProducer 發送訊息到不同的目的地

如何從單一 MessageProducer 發送訊息到不同的目的地?

使用 null 目的地建立 MessageProducer;然後每次發送時指定目的地…

MessageProducer producer = session.createProducer(null);
...
producer.send(someDestination, message);
...
producer.send(anotherDestination, message);

Apache、ActiveMQ、Apache ActiveMQ、Apache 羽毛標誌和 Apache ActiveMQ 專案標誌是 Apache 軟體基金會的商標。 版權所有 © 2024,Apache 軟體基金會。 根據 Apache 授權 2.0 授權。