Package org.apache.activemq.command

Examples of org.apache.activemq.command.ProducerId


    }

    public Response processMessage(Message send) throws Exception {
        if (send != null) {
            if (trackTransactions && send.getTransactionId() != null) {
                ProducerId producerId = send.getProducerId();
                ConnectionId connectionId = producerId.getParentId().getParentId();
                if (connectionId != null) {
                    ConnectionState cs = connectionStates.get(connectionId);
                    if (cs != null) {
                        TransactionState transactionState = cs.getTransactionState(send.getTransactionId());
                        if (transactionState != null) {
                            transactionState.addCommand(send);
                           
                            if (trackTransactionProducers) {
                                // for jmstemplate, track the producer in case it is closed before commit
                                // and needs to be replayed
                                SessionState ss = cs.getSessionState(producerId.getParentId());
                                ProducerState producerState = ss.getProducerState(producerId);
                                producerState.setTransactionState(transactionState);           
                            }
                        }
                    }
View Full Code Here


    /**
     * @return
     */
    private ProducerId createProducerId() {
        return new ProducerId(connectionSessionId, producerIdGenerator.getNextSequenceId());
    }
View Full Code Here

    private void writeObject(Object object) throws IOException {
        openWireformat.marshal(object, ds);
    }
   
    protected DataStructure createDataStructure(long index) {
        ProducerId id = new ProducerId();
        id.setConnectionId(connectionId);
        id.setSessionId(index);
        id.setValue(index);
       
        ProducerInfo object = new ProducerInfo();
        object.setProducerId(id);
        object.setDestination(destination);
        return object;
View Full Code Here

   
    protected void assertDataStructureExpected(DataStructure object, long i) {
        assertEquals("Type of object for index: " + i, ProducerInfo.class, object.getClass());
        ProducerInfo command = (ProducerInfo) object;
       
        ProducerId id = command.getProducerId();
        assertNotNull("ProducerID for object at index: " + i, id);
       
        assertEquals("connection ID in object: "+ i, connectionId, id.getConnectionId());
        String actual = Long.toHexString(id.getValue());
        String expected = Long.toHexString(i);
        assertEquals("value of object: "+ i + " was: " + actual, expected, actual);
        assertEquals("value of object: "+ i + " was: " + actual, i, id.getSessionId());
    }
View Full Code Here

    /**
     * @return
     */
    private ProducerId createProducerId() {
        return new ProducerId(connectionSessionId, producerIdGenerator.getNextSequenceId());
    }
View Full Code Here

        TransactionId[] preparedTransactions = broker.getPreparedTransactions(context);
        return new DataArrayResponse(preparedTransactions);
    }

    public Response processMessage(Message messageSend) throws Exception {
        ProducerId producerId = messageSend.getProducerId();
        ProducerBrokerExchange producerExchange = getProducerBrokerExchange(producerId);
        broker.send(producerExchange, messageSend);
        return null;
    }
View Full Code Here

            } catch (Throwable e) {
                LOG.warn("Failed to remove consumer: " + consumerId + ". Reason: " + e, e);
            }
        }
        for (Iterator iter = session.getProducerIds().iterator(); iter.hasNext();) {
            ProducerId producerId = (ProducerId) iter.next();
            try {
                processRemoveProducer(producerId);
            } catch (Throwable e) {
                LOG.warn("Failed to remove producer: " + producerId + ". Reason: " + e, e);
            }
View Full Code Here

    protected SessionId createSessionId(String string) {
        return new SessionId(createConnectionId(string), ++counter);
    }

    protected ProducerId createProducerId(String string) {
        return new ProducerId(createSessionId(string), ++counter);
    }
View Full Code Here

        int maxAuditDepth = Short.MAX_VALUE;

        ConnectionId connectionId = new ConnectionId(connectionIdGenerator.generateId());
        SessionId sessionId = new SessionId(connectionId, sessionIdGenerator.getNextSequenceId());
        ProducerId producerId = new ProducerId(sessionId, producerIdGenerator.getNextSequenceId());

        ActiveMQMessageAuditNoSync audit = new ActiveMQMessageAuditNoSync();
        audit.setAuditDepth(maxAuditDepth);

        MessageId msgId = new MessageId(producerId, 0);
View Full Code Here


    public static final ProducerIdTest SINGLETON = new ProducerIdTest();

    public Object createObject() throws Exception {
        ProducerId info = new ProducerId();
        populateObject(info);
        return info;
    }
View Full Code Here

TOP

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

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.