public ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info) { ConsumerInfo rc = new ConsumerInfo(); rc.setSelector(info.getSelector()); rc.setSubscriptionName(info.getSubscriptionName()); rc.setDestination(info.getSubscribedDestination()); rc.setConsumerId(createConsumerId()); rc.setNoLocal(info.isNoLocal()); return rc; }
final protected DemandSubscription createDemandSubscription(ActiveMQDestination destination, final String subscriptionName) { ConsumerInfo info = new ConsumerInfo(); info.setNetworkSubscription(true); info.setDestination(destination); if (subscriptionName != null) { info.setSubscriptionName(subscriptionName); } // Indicate that this subscription is being made on behalf of the remote broker. info.setBrokerPath(new BrokerId[]{remoteBrokerId}); // the remote info held by the DemandSubscription holds the original // consumerId, the local info get's overwritten info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); DemandSubscription result = null; try { result = createDemandSubscription(info); } catch (IOException e) { LOG.error("Failed to create DemandSubscription ", e); } return result; }
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()); value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn); info.setBrokerPath(value); } else { info.setBrokerPath(null);
@Override protected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException { boolean isForcedDurable = NetworkBridgeUtils.isForcedDurable(info, dynamicallyIncludedDestinations, staticallyIncludedDestinations); if (addToAlreadyInterestedConsumers(info, isForcedDurable)) { return null; // don't want this subscription added } //add our original id to ourselves info.addNetworkConsumerId(info.getConsumerId()); ConsumerId forcedDurableId = isForcedDurable ? info.getConsumerId() : null; if(info.isDurable() || isForcedDurable) { // set the subscriber name to something reproducible info.setSubscriptionName(getSubscriberName(info.getDestination())); // and override the consumerId with something unique so that it won't // be removed if the durable subscriber (at the other end) goes away info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); } info.setSelector(null); DemandSubscription demandSubscription = doCreateDemandSubscription(info); if (forcedDurableId != null) { demandSubscription.addForcedDurableConsumer(forcedDurableId); forcedDurableRemoteId.add(forcedDurableId); } return demandSubscription; }
consumerInfo.setConsumerId(consumerId); consumerInfo.setPrefetchSize(10); consumerInfo.setNoLocal(true); createConsumer = true; consumerInfo.setDestination(destination);
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()); value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn); info.setBrokerPath(value); } else { info.setBrokerPath(null);
@Override public ObjectName createDurableSubscriber(String clientId, String subscriberName, String topicName, String selector) throws Exception { ConnectionContext context = getConnectionContext(); context.setBroker(safeGetBroker()); context.setClientId(clientId); ConsumerInfo info = new ConsumerInfo(); ConsumerId consumerId = new ConsumerId(); consumerId.setConnectionId(clientId); consumerId.setSessionId(sessionIdCounter.incrementAndGet()); consumerId.setValue(0); info.setConsumerId(consumerId); info.setDestination(new ActiveMQTopic(topicName)); info.setSubscriptionName(subscriberName); info.setSelector(selector); Subscription subscription = safeGetBroker().addConsumer(context, info); safeGetBroker().removeConsumer(context, info); if (subscription != null) { return subscription.getObjectName(); } return null; }
final protected DemandSubscription createDemandSubscription(ActiveMQDestination destination, final String subscriptionName) { ConsumerInfo info = new ConsumerInfo(); info.setNetworkSubscription(true); info.setDestination(destination); if (subscriptionName != null) { info.setSubscriptionName(subscriptionName); } // Indicate that this subscription is being made on behalf of the remote broker. info.setBrokerPath(new BrokerId[]{remoteBrokerId}); // the remote info held by the DemandSubscription holds the original // consumerId, the local info get's overwritten info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); DemandSubscription result = null; try { result = createDemandSubscription(info); } catch (IOException e) { LOG.error("Failed to create DemandSubscription ", e); } return result; }
protected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException { if (addToAlreadyInterestedConsumers(info)) { return null; // don't want this subscription added } //add our original id to ourselves info.addNetworkConsumerId(info.getConsumerId()); if (info.isDurable()) { // set the subscriber name to something reproducible info.setSubscriptionName(getSubscriberName(info.getDestination())); // and override the consumerId with something unique so that it won't // be removed if the durable subscriber (at the other end) goes away info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator .getNextSequenceId())); } info.setSelector(null); return doCreateDemandSubscription(info); }
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()); value[i] = (org.apache.activemq.command.BrokerId)looseUnmarsalNestedObject(wireFormat, dataIn); info.setBrokerPath(value); } else { info.setBrokerPath(null);
public ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info) { ConsumerInfo rc = new ConsumerInfo(); rc.setSelector(info.getSelector()); rc.setSubscriptionName(info.getSubscriptionName()); rc.setDestination(info.getSubscribedDestination()); rc.setConsumerId(createConsumerId()); rc.setNoLocal(info.isNoLocal()); return rc; }
final protected DemandSubscription createDemandSubscription(ActiveMQDestination destination, final String subscriptionName) { ConsumerInfo info = new ConsumerInfo(); info.setNetworkSubscription(true); info.setDestination(destination); if (subscriptionName != null) { info.setSubscriptionName(subscriptionName); } // Indicate that this subscription is being made on behalf of the remote broker. info.setBrokerPath(new BrokerId[]{remoteBrokerId}); // the remote info held by the DemandSubscription holds the original // consumerId, the local info get's overwritten info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); DemandSubscription result = null; try { result = createDemandSubscription(info); } catch (IOException e) { LOG.error("Failed to create DemandSubscription ", e); } return result; }
@Override protected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException { boolean isForcedDurable = NetworkBridgeUtils.isForcedDurable(info, dynamicallyIncludedDestinations, staticallyIncludedDestinations); if (addToAlreadyInterestedConsumers(info, isForcedDurable)) { return null; // don't want this subscription added } //add our original id to ourselves info.addNetworkConsumerId(info.getConsumerId()); ConsumerId forcedDurableId = isForcedDurable ? info.getConsumerId() : null; if(info.isDurable() || isForcedDurable) { // set the subscriber name to something reproducible info.setSubscriptionName(getSubscriberName(info.getDestination())); // and override the consumerId with something unique so that it won't // be removed if the durable subscriber (at the other end) goes away info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); } info.setSelector(null); DemandSubscription demandSubscription = doCreateDemandSubscription(info); if (forcedDurableId != null) { demandSubscription.addForcedDurableConsumer(forcedDurableId); forcedDurableRemoteId.add(forcedDurableId); } return demandSubscription; }
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()); value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); info.setBrokerPath(value); info.setBrokerPath(null); info.setAdditionalPredicate((org.apache.activemq.filter.BooleanExpression) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setNetworkSubscription(dataIn.readBoolean()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
public ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info) { ConsumerInfo rc = new ConsumerInfo(); rc.setSelector(info.getSelector()); rc.setSubscriptionName(info.getSubscriptionName()); rc.setDestination(info.getSubscribedDestination()); rc.setConsumerId(createConsumerId()); rc.setNoLocal(info.isNoLocal()); return rc; }
final protected DemandSubscription createDemandSubscription(ActiveMQDestination destination, final String subscriptionName) { ConsumerInfo info = new ConsumerInfo(); info.setNetworkSubscription(true); info.setDestination(destination); if (subscriptionName != null) { info.setSubscriptionName(subscriptionName); } // Indicate that this subscription is being made on behalf of the remote broker. info.setBrokerPath(new BrokerId[]{remoteBrokerId}); // the remote info held by the DemandSubscription holds the original // consumerId, the local info get's overwritten info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); DemandSubscription result = null; try { result = createDemandSubscription(info); } catch (IOException e) { LOG.error("Failed to create DemandSubscription ", e); } return result; }
@Override protected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException { boolean isForcedDurable = NetworkBridgeUtils.isForcedDurable(info, dynamicallyIncludedDestinations, staticallyIncludedDestinations); if (addToAlreadyInterestedConsumers(info, isForcedDurable)) { return null; // don't want this subscription added } //add our original id to ourselves info.addNetworkConsumerId(info.getConsumerId()); ConsumerId forcedDurableId = isForcedDurable ? info.getConsumerId() : null; if(info.isDurable() || isForcedDurable) { // set the subscriber name to something reproducible info.setSubscriptionName(getSubscriberName(info.getDestination())); // and override the consumerId with something unique so that it won't // be removed if the durable subscriber (at the other end) goes away info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); } info.setSelector(null); DemandSubscription demandSubscription = doCreateDemandSubscription(info); if (forcedDurableId != null) { demandSubscription.addForcedDurableConsumer(forcedDurableId); forcedDurableRemoteId.add(forcedDurableId); } return demandSubscription; }
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()); value[i] = (org.apache.activemq.command.BrokerId) looseUnmarsalNestedObject(wireFormat,dataIn); info.setBrokerPath(value); info.setBrokerPath(null); info.setAdditionalPredicate((org.apache.activemq.filter.BooleanExpression) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setNetworkSubscription(dataIn.readBoolean()); info.setOptimizedAcknowledge(dataIn.readBoolean()); info.setNoRangeAcks(dataIn.readBoolean());
public ConsumerInfo createInactiveConsumerInfo(SubscriptionInfo info) { ConsumerInfo rc = new ConsumerInfo(); rc.setSelector(info.getSelector()); rc.setSubscriptionName(info.getSubscriptionName()); rc.setDestination(info.getSubscribedDestination()); rc.setConsumerId(createConsumerId()); rc.setNoLocal(info.isNoLocal()); return rc; }
@Override protected DemandSubscription createDemandSubscription(ConsumerInfo info) throws IOException { boolean isForcedDurable = NetworkBridgeUtils.isForcedDurable(info, dynamicallyIncludedDestinations, staticallyIncludedDestinations); if (addToAlreadyInterestedConsumers(info, isForcedDurable)) { return null; // don't want this subscription added } //add our original id to ourselves info.addNetworkConsumerId(info.getConsumerId()); ConsumerId forcedDurableId = isForcedDurable ? info.getConsumerId() : null; if(info.isDurable() || isForcedDurable) { // set the subscriber name to something reproducible info.setSubscriptionName(getSubscriberName(info.getDestination())); // and override the consumerId with something unique so that it won't // be removed if the durable subscriber (at the other end) goes away info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId())); } info.setSelector(null); DemandSubscription demandSubscription = doCreateDemandSubscription(info); if (forcedDurableId != null) { demandSubscription.addForcedDurableConsumer(forcedDurableId); forcedDurableRemoteId.add(forcedDurableId); } return demandSubscription; }