Package org.apache.activemq.command

Examples of org.apache.activemq.command.ConsumerId


        Object obj = ((ActiveMQMessage) advisoryMessage).getDataStructure();
        if (obj instanceof ConsumerInfo) {
            ConsumerInfo info = (ConsumerInfo) obj;
            addClusterNode(info.getConsumerId().getConnectionId());
        } else if (obj instanceof RemoveInfo) {
            ConsumerId consumerId = (ConsumerId) ((RemoveInfo) obj).getObjectId();
            removeClusterNode(consumerId.getConnectionId());
        }
    }
View Full Code Here


                if (endpoints[i] instanceof InternalEndpoint && ((InternalEndpoint) endpoints[i]).isLocal()) {
                    onInternalEndpointRegistered(new EndpointEvent(endpoints[i], EndpointEvent.INTERNAL_ENDPOINT_REGISTERED), true);
                }
            }
        } else if (obj instanceof RemoveInfo) {
            ConsumerId id = (ConsumerId) ((RemoveInfo) obj).getObjectId();
            subscriberSet.remove(id.getConnectionId());
            removeAllPackets(id.getConnectionId());
        }
    }
View Full Code Here

        Object obj = ((ActiveMQMessage) advisoryMessage).getDataStructure();
        if (obj instanceof ConsumerInfo) {
            ConsumerInfo info = (ConsumerInfo) obj;
            addClusterNode(info.getConsumerId().getConnectionId());
        } else if (obj instanceof RemoveInfo) {
            ConsumerId consumerId = (ConsumerId) ((RemoveInfo) obj).getObjectId();
            removeClusterNode(consumerId.getConnectionId());
        }
    }
View Full Code Here

                if (endpoints[i] instanceof InternalEndpoint && ((InternalEndpoint) endpoints[i]).isLocal()) {
                    onInternalEndpointRegistered(new EndpointEvent(endpoints[i], EndpointEvent.INTERNAL_ENDPOINT_REGISTERED), true);
                }
            }
        } else if (obj instanceof RemoveInfo) {
            ConsumerId id = (ConsumerId) ((RemoveInfo) obj).getObjectId();
            subscriberSet.remove(id.getConnectionId());
            removeAllPackets(id.getConnectionId());
        }
    }
View Full Code Here

            }
            destInfo.setBrokerPath(appendToBrokerPath(destInfo.getBrokerPath(), getRemoteBrokerPath()));
            LOG.debug("Replying destination control command: " + destInfo);
            localBroker.oneway(destInfo);
        } else if (data.getClass() == RemoveInfo.class) {
            ConsumerId id = (ConsumerId)((RemoveInfo)data).getObjectId();
            removeDemandSubscription(id);
        }
    }
View Full Code Here

        return doCreateDemandSubscription(info);
    }

    protected DemandSubscription doCreateDemandSubscription(ConsumerInfo info) throws IOException {
        DemandSubscription result = new DemandSubscription(info);
        result.getLocalInfo().setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator.getNextSequenceId()));
        if (info.getDestination().isTemporary()) {
            // reset the local connection Id

            ActiveMQTempDestination dest = (ActiveMQTempDestination)result.getLocalInfo().getDestination();
            dest.setConnectionId(localConnectionInfo.getConnectionId().toString());
View Full Code Here

        ConsumerInfo info = new ConsumerInfo();
        info.setDestination(destination);
        // 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 = new DemandSubscription(info);
        result.getLocalInfo().setPriority(ConsumerInfo.NETWORK_CONSUMER_PRIORITY);
        return result;
    }
View Full Code Here

                }
            }

            // Make sure that the previous owner is still valid, we may
            // need to become the new owner.
            ConsumerId groupOwner;
            synchronized (node) {
                groupOwner = messageGroupOwners.get(groupId);
                if (groupOwner == null) {
                    if (node.lock(this)) {
                        assignGroupToMe(messageGroupOwners, n, groupId);
                        return true;
                    } else {
                        return false;
                    }
                }
            }

            if (groupOwner.equals(info.getConsumerId())) {
                // A group sequence < 1 is an end of group signal.
                if (sequence < 0) {
                    messageGroupOwners.removeGroup(groupId);
                }
                return true;
View Full Code Here

        // not matched so create a new one
        // but first, if it's durable - changed set the
        // ConsumerId here - so it won't be removed if the
        // durable subscriber goes away on the other end
        if (info.isDurable() || (info.getDestination().isQueue() && !info.getDestination().isTemporary())) {
            info.setConsumerId(new ConsumerId(localSessionInfo.getSessionId(), consumerIdGenerator
                .getNextSequenceId()));
        }
        if (info.isDurable()) {
            // set the subscriber name to something reproducible
View Full Code Here

    boolean wasExclusiveOwner=false;
    if(exclusiveOwner==sub){
      exclusiveOwner=null;
      wasExclusiveOwner=true;
    }
    ConsumerId consumerId=sub.getConsumerInfo().getConsumerId();
    MessageGroupSet ownedGroups=getMessageGroupOwners().removeConsumer(
            consumerId);
    if(!sub.getConsumerInfo().isBrowser()){
      MessageEvaluationContext msgContext=context
              .getMessageEvaluationContext();
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ConsumerId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.