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());
}
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"));
}
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);
}
Aggregations