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; }
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());
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); ConsumerId consumerId = createConsumerId(); ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); consumerInfo.setSelector(messageSelector); consumerInfo.setPrefetchSize(maxMessages); consumerInfo.setNoLocal(noLocal); consumerInfo.setDispatchAsync(isDispatchAsync()); // Allows the options on the destination to configure the consumerInfo if (consumerInfo.getDestination().getOptions() != null) { Map<String, String> options = new HashMap<>(consumerInfo.getDestination().getOptions()); IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); } return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); }
SessionId sessionId = new SessionId(info.getConnectionId(), -1); ConsumerInfo info = new ConsumerInfo(new ConsumerId(sessionId, consumerIdGenerator.getNextSequenceId())); info.setDestination(ActiveMQMessageTransformation.transformDestination(topic)); info.setSubscriptionName(subscriptionName); info.setSelector(messageSelector); info.setPrefetchSize(maxMessages); info.setDispatchAsync(isDispatchAsync());
@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());
@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; }
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); ConsumerId consumerId = createConsumerId(); ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); consumerInfo.setSelector(messageSelector); consumerInfo.setPrefetchSize(maxMessages); consumerInfo.setNoLocal(noLocal); consumerInfo.setDispatchAsync(isDispatchAsync()); // Allows the options on the destination to configure the consumerInfo if (consumerInfo.getDestination().getOptions() != null) { Map<String, String> options = new HashMap<>(consumerInfo.getDestination().getOptions()); IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); } return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); }
SessionId sessionId = new SessionId(info.getConnectionId(), -1); ConsumerInfo info = new ConsumerInfo(new ConsumerId(sessionId, consumerIdGenerator.getNextSequenceId())); info.setDestination(ActiveMQMessageTransformation.transformDestination(topic)); info.setSubscriptionName(subscriptionName); info.setSelector(messageSelector); info.setPrefetchSize(maxMessages); info.setDispatchAsync(isDispatchAsync());
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());
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; }
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); ConsumerId consumerId = createConsumerId(); ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); consumerInfo.setSelector(messageSelector); consumerInfo.setPrefetchSize(maxMessages); consumerInfo.setNoLocal(noLocal); consumerInfo.setDispatchAsync(isDispatchAsync()); // Allows the options on the destination to configure the consumerInfo if (consumerInfo.getDestination().getOptions() != null) { Map<String, String> options = new HashMap<>(consumerInfo.getDestination().getOptions()); IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); } return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); }
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());
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; }
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); ConsumerId consumerId = createConsumerId(); ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); consumerInfo.setSelector(messageSelector); consumerInfo.setPrefetchSize(maxMessages); consumerInfo.setNoLocal(noLocal); consumerInfo.setDispatchAsync(isDispatchAsync()); // Allows the options on the destination to configure the consumerInfo if (consumerInfo.getDestination().getOptions() != null) { Map<String, String> options = new HashMap<>(consumerInfo.getDestination().getOptions()); IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); } return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); }
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());
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; }
public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector, ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws JMSException { checkClosedOrFailed(); ensureConnectionInfoSent(); ConsumerId consumerId = createConsumerId(); ConsumerInfo consumerInfo = new ConsumerInfo(consumerId); consumerInfo.setDestination(ActiveMQMessageTransformation.transformDestination(destination)); consumerInfo.setSelector(messageSelector); consumerInfo.setPrefetchSize(maxMessages); consumerInfo.setNoLocal(noLocal); consumerInfo.setDispatchAsync(isDispatchAsync()); // Allows the options on the destination to configure the consumerInfo if (consumerInfo.getDestination().getOptions() != null) { Map<String, String> options = new HashMap<String, String>(consumerInfo.getDestination().getOptions()); IntrospectionSupport.setProperties(consumerInfo, options, "consumer."); } return new ActiveMQConnectionConsumer(this, sessionPool, consumerInfo); }
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());