use of org.apache.activemq.command.ConsumerInfo in project activemq-artemis by apache.
the class ConsumerInfoTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
ConsumerInfo info = (ConsumerInfo) object;
info.setConsumerId(createConsumerId("ConsumerId:1"));
info.setBrowser(true);
info.setDestination(createActiveMQDestination("Destination:2"));
info.setPrefetchSize(1);
info.setMaximumPendingMessageLimit(2);
info.setDispatchAsync(false);
info.setSelector("Selector:3");
info.setSubscriptionName("SubscriptionName:4");
info.setNoLocal(true);
info.setExclusive(false);
info.setRetroactive(true);
info.setPriority((byte) 1);
{
BrokerId[] value = new BrokerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createBrokerId("BrokerPath:5");
}
info.setBrokerPath(value);
}
info.setAdditionalPredicate(createBooleanExpression("AdditionalPredicate:6"));
info.setNetworkSubscription(false);
info.setOptimizedAcknowledge(true);
info.setNoRangeAcks(false);
{
ConsumerId[] value = new ConsumerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createConsumerId("NetworkConsumerPath:7");
}
info.setNetworkConsumerPath(value);
}
}
use of org.apache.activemq.command.ConsumerInfo in project activemq-artemis by apache.
the class NetworkRouteTest method addAndRemoveOppositeOrder.
@Test
public void addAndRemoveOppositeOrder() throws Exception {
// from (1)
localBroker.request(EasyMock.isA(ConsumerInfo.class));
ArgHolder localConsumer = ArgHolder.holdArgsForLastObjectCall();
// from (2a)
remoteBroker.asyncRequest(EasyMock.isA(ActiveMQMessage.class), EasyMock.isA(ResponseCallback.class));
ArgHolder firstMessageFuture = ArgHolder.holdArgsForLastFutureRequestCall();
localBroker.oneway(EasyMock.isA(MessageAck.class));
// from (2b)
remoteBroker.asyncRequest(EasyMock.isA(ActiveMQMessage.class), EasyMock.isA(ResponseCallback.class));
ArgHolder secondMessageFuture = ArgHolder.holdArgsForLastFutureRequestCall();
localBroker.oneway(EasyMock.isA(MessageAck.class));
// from (3)
localBroker.oneway(EasyMock.isA(RemoveInfo.class));
ExpectationWaiter waitForRemove = ExpectationWaiter.waiterForLastVoidCall();
control.replay();
// (1) send advisory of path 1
remoteListener.onCommand(path1Msg);
msgDispatch.setConsumerId(((ConsumerInfo) localConsumer.arguments[0]).getConsumerId());
// send advisory of path 2, doesn't send a ConsumerInfo to localBroker
remoteListener.onCommand(path2Msg);
// (2a) send a message
localListener.onCommand(msgDispatch);
ResponseCallback callback = (ResponseCallback) firstMessageFuture.arguments[1];
FutureResponse response = new FutureResponse(callback);
response.set(new Response());
// send advisory of path 2 remove, doesn't send a RemoveInfo to localBroker
remoteListener.onCommand(removePath2Msg);
// (2b) send a message
localListener.onCommand(msgDispatch);
callback = (ResponseCallback) secondMessageFuture.arguments[1];
response = new FutureResponse(callback);
response.set(new Response());
// (3) send advisory of path 1 remove, sends a RemoveInfo to localBroker
remoteListener.onCommand(removePath1Msg);
waitForRemove.assertHappens(5, TimeUnit.SECONDS);
// send a message, does not send message as in 2a and 2b
localListener.onCommand(msgDispatch);
control.verify();
}
use of org.apache.activemq.command.ConsumerInfo in project activemq-artemis by apache.
the class ConsumerInfoTest method createObject.
@Override
public Object createObject() throws Exception {
ConsumerInfo info = new ConsumerInfo();
populateObject(info);
return info;
}
use of org.apache.activemq.command.ConsumerInfo in project activemq-artemis by apache.
the class ConsumerInfoTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
ConsumerInfo info = (ConsumerInfo) object;
info.setConsumerId(createConsumerId("ConsumerId:1"));
info.setBrowser(true);
info.setDestination(createActiveMQDestination("Destination:2"));
info.setPrefetchSize(1);
info.setMaximumPendingMessageLimit(2);
info.setDispatchAsync(false);
info.setSelector("Selector:3");
info.setSubscriptionName("SubscriptionName:4");
info.setNoLocal(true);
info.setExclusive(false);
info.setRetroactive(true);
info.setPriority((byte) 1);
{
BrokerId[] value = new BrokerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createBrokerId("BrokerPath:5");
}
info.setBrokerPath(value);
}
info.setAdditionalPredicate(createBooleanExpression("AdditionalPredicate:6"));
info.setNetworkSubscription(false);
info.setOptimizedAcknowledge(true);
info.setNoRangeAcks(false);
{
ConsumerId[] value = new ConsumerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createConsumerId("NetworkConsumerPath:7");
}
info.setNetworkConsumerPath(value);
}
}
use of org.apache.activemq.command.ConsumerInfo in project activemq-artemis by apache.
the class ConsumerInfoTest method createObject.
@Override
public Object createObject() throws Exception {
ConsumerInfo info = new ConsumerInfo();
populateObject(info);
return info;
}
Aggregations