本文整理汇总了Java中org.apache.activemq.broker.Broker.getDestinations方法的典型用法代码示例。如果您正苦于以下问题:Java Broker.getDestinations方法的具体用法?Java Broker.getDestinations怎么用?Java Broker.getDestinations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.broker.Broker
的用法示例。
在下文中一共展示了Broker.getDestinations方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendToDestination
import org.apache.activemq.broker.Broker; //导入方法依赖的package包/类
private void sendToDestination(Broker broker, ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
if (broker.getDestinations(destination).isEmpty()) {
broker.getBrokerService().getRegionBroker().addDestination(broker.getAdminConnectionContext(), destination,true);
}
for (Destination dest : broker.getDestinations(destination)) {
logger.debug("Following search sending request to Destination " + dest.getName());
dest.send(context, message.copy());
}
}
示例2: send
import org.apache.activemq.broker.Broker; //导入方法依赖的package包/类
/**
* Sends a message to the given destination which may be a wildcard
*
* @param context broker context
* @param message message to send
* @param destination possibly wildcard destination to send the message to
* @throws Exception on error
*/
protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
Broker broker = context.getConnectionContext().getBroker();
Set<Destination> destinations = broker.getDestinations(destination);
for (Destination dest : destinations) {
dest.send(context, message.copy());
}
}
示例3: isPrioritizedMessageSubscriber
import org.apache.activemq.broker.Broker; //导入方法依赖的package包/类
public static boolean isPrioritizedMessageSubscriber(Broker broker,Subscription sub) {
boolean result = false;
Set<Destination> destinations = broker.getDestinations(sub.getActiveMQDestination());
if (destinations != null) {
for (Destination dest:destinations) {
if (dest.isPrioritizedMessages()) {
result = true;
break;
}
}
}
return result;
}
示例4: send
import org.apache.activemq.broker.Broker; //导入方法依赖的package包/类
/**
* Respect the selectors of the subscriptions to ensure only matched messages are dispatched to
* the virtual queues, hence there is no build up of unmatched messages on these destinations
*/
@Override
protected void send(ProducerBrokerExchange context, Message message, ActiveMQDestination destination) throws Exception {
Broker broker = context.getConnectionContext().getBroker();
Set<Destination> destinations = broker.getDestinations(destination);
for (Destination dest : destinations) {
if (matchesSomeConsumer(broker, message, dest)) {
dest.send(context, message.copy());
}
}
}