info.setBrowser(dataIn.readBoolean()); info .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject( wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); dataIn)); info.setNetworkSubscription(dataIn.readBoolean()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
queueConsumerInfo.setDispatchAsync(dispatchAsync); queueConsumerInfo.setDestination(new ActiveMQQueue(destinationFilter)); queueConsumerInfo.setPrefetchSize(prefetchSize); queueConsumerInfo.setPriority(ConsumerInfo.NETWORK_CONSUMER_PRIORITY); localBroker.oneway(queueConsumerInfo); topicConsumerInfo.setDispatchAsync(dispatchAsync); topicConsumerInfo.setSubscriptionName("topic-bridge"); topicConsumerInfo.setRetroactive(true); topicConsumerInfo.setDestination(new ActiveMQTopic(destinationFilter)); topicConsumerInfo.setPrefetchSize(prefetchSize); topicConsumerInfo.setPriority(ConsumerInfo.NETWORK_CONSUMER_PRIORITY); localBroker.oneway(topicConsumerInfo);
info.setBrowser(dataIn.readBoolean()); info .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject( wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); dataIn)); info.setNetworkSubscription(dataIn.readBoolean()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
private void restoreDurableQueue(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length()); StringTokenizer tokenizer = new StringTokenizer(name); tokenizer.nextToken(":."); String qosString = tokenizer.nextToken(); tokenizer.nextToken(); String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1)); QoS qoS = QoS.valueOf(qosString); LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(queue); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH); if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); doSubscribe(consumerInfo, topicName, qoS); // mark this durable subscription as restored by Broker restoredQueues.add(queue); } } catch (IOException e) { LOG.warn("Could not restore the MQTT queue subscriptions.", e); } }
info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setBrowser(dataIn.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
private void restoreDurableQueue(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length()); StringTokenizer tokenizer = new StringTokenizer(name); tokenizer.nextToken(":."); String qosString = tokenizer.nextToken(); tokenizer.nextToken(); String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1)); QoS qoS = QoS.valueOf(qosString); LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(queue); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH); if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); doSubscribe(consumerInfo, topicName, qoS); // mark this durable subscription as restored by Broker restoredQueues.add(queue); } } catch (IOException e) { LOG.warn("Could not restore the MQTT queue subscriptions.", e); } }
info.setBrowser(dataIn.readBoolean()); info .setDestination((org.apache.activemq.command.ActiveMQDestination)looseUnmarsalCachedObject( wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); dataIn)); info.setNetworkSubscription(dataIn.readBoolean()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
private void restoreDurableQueue(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length()); StringTokenizer tokenizer = new StringTokenizer(name); tokenizer.nextToken(":."); String qosString = tokenizer.nextToken(); tokenizer.nextToken(); String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1)); QoS qoS = QoS.valueOf(qosString); LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(queue); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH); if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); doSubscribe(consumerInfo, topicName, qoS); // mark this durable subscription as restored by Broker restoredQueues.add(queue); } } catch (IOException e) { LOG.warn("Could not restore the MQTT queue subscriptions.", e); } }
info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setBrowser(dataIn.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
private byte onSubscribe(String topicName, QoS requestedQoS) throws MQTTProtocolException { ActiveMQDestination destination = new ActiveMQTopic(MQTTProtocolSupport.convertMQTTToActiveMQ(topicName)); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(destination); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH); consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); // create durable subscriptions only when clean session is false if (!isCleanSession() && getClientId() != null && requestedQoS.ordinal() >= QoS.AT_LEAST_ONCE.ordinal()) { consumerInfo.setSubscriptionName(requestedQoS + ":" + topicName); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH); } if (getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(getActiveMQSubscriptionPrefetch()); } return doSubscribe(consumerInfo, topicName, requestedQoS); }
info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setBrowser(dataIn.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
private byte onSubscribe(String topicName, QoS requestedQoS) throws MQTTProtocolException { ActiveMQDestination destination = new ActiveMQTopic(MQTTProtocolSupport.convertMQTTToActiveMQ(topicName)); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(destination); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH); consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); // create durable subscriptions only when clean session is false if (!isCleanSession() && getClientId() != null && requestedQoS.ordinal() >= QoS.AT_LEAST_ONCE.ordinal()) { consumerInfo.setSubscriptionName(requestedQoS + ":" + topicName); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH); } if (getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(getActiveMQSubscriptionPrefetch()); } return doSubscribe(consumerInfo, topicName, requestedQoS); }
info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setBrowser(dataIn.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setClientId(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
@Override public byte onSubscribe(String topicName, QoS requestedQoS) throws MQTTProtocolException { ActiveMQDestination destination = new ActiveMQTopic(MQTTProtocolSupport.convertMQTTToActiveMQ(topicName)); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(destination); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH); consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); // create durable subscriptions only when clean session is false if (!protocol.isCleanSession() && protocol.getClientId() != null && requestedQoS.ordinal() >= QoS.AT_LEAST_ONCE.ordinal()) { consumerInfo.setSubscriptionName(requestedQoS + ":" + topicName); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH); } if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } return doSubscribe(consumerInfo, topicName, requestedQoS); }
info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setBrowser(dataIn.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setClientId(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
@Override public byte onSubscribe(String topicName, QoS requestedQoS) throws MQTTProtocolException { ActiveMQDestination destination = new ActiveMQTopic(MQTTProtocolSupport.convertMQTTToActiveMQ(topicName)); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(destination); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH); consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); // create durable subscriptions only when clean session is false if (!protocol.isCleanSession() && protocol.getClientId() != null && requestedQoS.ordinal() >= QoS.AT_LEAST_ONCE.ordinal()) { consumerInfo.setSubscriptionName(requestedQoS + ":" + topicName); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH); } if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } return doSubscribe(consumerInfo, topicName, requestedQoS); }
info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setBrowser(dataIn.readBoolean()); info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(dataIn.readBoolean()); info.setSelector(looseUnmarshalString(dataIn)); info.setClientId(looseUnmarshalString(dataIn)); info.setSubscriptionName(looseUnmarshalString(dataIn)); info.setNoLocal(dataIn.readBoolean()); info.setExclusive(dataIn.readBoolean()); info.setRetroactive(dataIn.readBoolean()); info.setPriority(dataIn.readByte()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
@Override public byte onSubscribe(String topicName, QoS requestedQoS) throws MQTTProtocolException { ActiveMQDestination destination = new ActiveMQTopic(MQTTProtocolSupport.convertMQTTToActiveMQ(topicName)); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(destination); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_TOPIC_PREFETCH); consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); // create durable subscriptions only when clean session is false if (!protocol.isCleanSession() && protocol.getClientId() != null && requestedQoS.ordinal() >= QoS.AT_LEAST_ONCE.ordinal()) { consumerInfo.setSubscriptionName(requestedQoS + ":" + topicName); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_DURABLE_TOPIC_PREFETCH); } if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } return doSubscribe(consumerInfo, topicName, requestedQoS); }
info.setBrowser(bs.readBoolean()); info .setDestination((org.apache.activemq.command.ActiveMQDestination)tightUnmarsalCachedObject( wireFormat, dataIn, bs)); info.setPrefetchSize(dataIn.readInt()); info.setMaximumPendingMessageLimit(dataIn.readInt()); info.setDispatchAsync(bs.readBoolean()); info.setSelector(tightUnmarshalString(dataIn, bs)); info.setSubscriptionName(tightUnmarshalString(dataIn, bs)); info.setNoLocal(bs.readBoolean()); info.setExclusive(bs.readBoolean()); info.setRetroactive(bs.readBoolean()); info.setPriority(dataIn.readByte()); bs)); info.setNetworkSubscription(bs.readBoolean()); info.setOptimizedAcknowledge(bs.readBoolean()); info.setNoRangeAcks(bs.readBoolean());
queueConsumerInfo.setDispatchAsync(dispatchAsync); queueConsumerInfo.setDestination(new ActiveMQQueue(destinationFilter)); queueConsumerInfo.setPrefetchSize(prefetchSize); queueConsumerInfo.setPriority(ConsumerInfo.NETWORK_CONSUMER_PRIORITY); localBroker.oneway(queueConsumerInfo); topicConsumerInfo.setDispatchAsync(dispatchAsync); topicConsumerInfo.setSubscriptionName("topic-bridge"); topicConsumerInfo.setRetroactive(true); topicConsumerInfo.setDestination(new ActiveMQTopic(destinationFilter)); topicConsumerInfo.setPrefetchSize(prefetchSize); topicConsumerInfo.setPriority(ConsumerInfo.NETWORK_CONSUMER_PRIORITY); localBroker.oneway(topicConsumerInfo);