Java Code Examples for org.apache.activemq.command.ActiveMQDestination#isComposite()

The following examples show how to use org.apache.activemq.command.ActiveMQDestination#isComposite() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AMQSession.java    From activemq-artemis with Apache License 2.0 5 votes vote down vote up
public List<AMQConsumer> createConsumer(ConsumerInfo info,
                                        SlowConsumerDetectionListener slowConsumerDetectionListener) throws Exception {
   //check destination
   ActiveMQDestination dest = info.getDestination();
   ActiveMQDestination[] dests = null;
   if (dest.isComposite()) {
      dests = dest.getCompositeDestinations();
   } else {
      dests = new ActiveMQDestination[]{dest};
   }

   List<AMQConsumer> consumersList = new java.util.LinkedList<>();

   for (ActiveMQDestination openWireDest : dests) {
      boolean isInternalAddress = false;
      if (AdvisorySupport.isAdvisoryTopic(dest)) {
         if (!connection.isSuppportAdvisory()) {
            continue;
         }
         isInternalAddress = connection.isSuppressInternalManagementObjects();
      }
      if (openWireDest.isQueue()) {
         openWireDest = protocolManager.virtualTopicConsumerToFQQN(openWireDest);
         SimpleString queueName = new SimpleString(convertWildcard(openWireDest));

         if (!checkAutoCreateQueue(queueName, openWireDest.isTemporary())) {
            throw new InvalidDestinationException("Destination doesn't exist: " + queueName);
         }
      }
      AMQConsumer consumer = new AMQConsumer(this, openWireDest, info, scheduledPool, isInternalAddress);

      long nativeID = consumerIDGenerator.generateID();
      consumer.init(slowConsumerDetectionListener, nativeID);
      consumersList.add(consumer);
   }

   return consumersList;
}
 
Example 2
Source File: XARecoveryBrokerTest.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
private ActiveMQDestination[] destinationList(ActiveMQDestination dest) {
   return dest.isComposite() ? dest.getCompositeDestinations() : new ActiveMQDestination[]{dest};
}
 
Example 3
Source File: XARecoveryBrokerTest.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
private int expectedMessageCount(int i, ActiveMQDestination destination) {
   return i * (destination.isComposite() ? destination.getCompositeDestinations().length : 1);
}