Search in sources :

Example 36 with MessageAck

use of org.apache.activemq.command.MessageAck in project activemq-artemis by apache.

the class FailoverTransportTest method testCommandsIgnoredWhenOffline.

@Test(timeout = 30000)
public void testCommandsIgnoredWhenOffline() throws Exception {
    this.transport = createTransport();
    assertNotNull(failoverTransport);
    ConnectionStateTracker tracker = failoverTransport.getStateTracker();
    assertNotNull(tracker);
    ConnectionId id = new ConnectionId("1");
    ConnectionInfo connection = new ConnectionInfo(id);
    // Track a connection
    tracker.track(connection);
    try {
        this.transport.oneway(new RemoveInfo(new ConnectionId("1")));
    } catch (Exception e) {
        fail("Should not have failed to remove this known connection");
    }
    try {
        this.transport.oneway(new RemoveInfo(new ConnectionId("2")));
    } catch (Exception e) {
        fail("Should not have failed to remove this unknown connection");
    }
    this.transport.oneway(new MessageAck());
    this.transport.oneway(new ShutdownInfo());
}
Also used : ConnectionId(org.apache.activemq.command.ConnectionId) RemoveInfo(org.apache.activemq.command.RemoveInfo) MessageAck(org.apache.activemq.command.MessageAck) ConnectionStateTracker(org.apache.activemq.state.ConnectionStateTracker) ConnectionInfo(org.apache.activemq.command.ConnectionInfo) ShutdownInfo(org.apache.activemq.command.ShutdownInfo) IOException(java.io.IOException) Test(org.junit.Test)

Example 37 with MessageAck

use of org.apache.activemq.command.MessageAck in project activemq-artemis by apache.

the class MessageAckTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    MessageAck info = (MessageAck) object;
    info.setDestination(createActiveMQDestination("Destination:1"));
    info.setTransactionId(createTransactionId("TransactionId:2"));
    info.setConsumerId(createConsumerId("ConsumerId:3"));
    info.setAckType((byte) 1);
    info.setFirstMessageId(createMessageId("FirstMessageId:4"));
    info.setLastMessageId(createMessageId("LastMessageId:5"));
    info.setMessageCount(1);
    info.setPoisonCause(createThrowable("PoisonCause:6"));
}
Also used : MessageAck(org.apache.activemq.command.MessageAck)

Example 38 with MessageAck

use of org.apache.activemq.command.MessageAck in project activemq-artemis by apache.

the class MessageAckTest method populateObject.

@Override
protected void populateObject(Object object) throws Exception {
    super.populateObject(object);
    MessageAck info = (MessageAck) object;
    info.setDestination(createActiveMQDestination("Destination:1"));
    info.setTransactionId(createTransactionId("TransactionId:2"));
    info.setConsumerId(createConsumerId("ConsumerId:3"));
    info.setAckType((byte) 1);
    info.setFirstMessageId(createMessageId("FirstMessageId:4"));
    info.setLastMessageId(createMessageId("LastMessageId:5"));
    info.setMessageCount(1);
}
Also used : MessageAck(org.apache.activemq.command.MessageAck)

Aggregations

MessageAck (org.apache.activemq.command.MessageAck)38 ConnectionInfo (org.apache.activemq.command.ConnectionInfo)15 ConsumerInfo (org.apache.activemq.command.ConsumerInfo)15 Message (org.apache.activemq.command.Message)15 ProducerInfo (org.apache.activemq.command.ProducerInfo)14 SessionInfo (org.apache.activemq.command.SessionInfo)14 ActiveMQDestination (org.apache.activemq.command.ActiveMQDestination)12 XATransactionId (org.apache.activemq.command.XATransactionId)9 DataArrayResponse (org.apache.activemq.command.DataArrayResponse)5 TransactionInfo (org.apache.activemq.command.TransactionInfo)5 ActiveMQQueue (org.apache.activemq.command.ActiveMQQueue)4 LocalTransactionId (org.apache.activemq.command.LocalTransactionId)4 ActiveMQTopic (org.apache.activemq.command.ActiveMQTopic)3 ConnectionId (org.apache.activemq.command.ConnectionId)2 RemoveInfo (org.apache.activemq.command.RemoveInfo)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 Vector (java.util.Vector)1 CountDownLatch (java.util.concurrent.CountDownLatch)1