Search in sources :

Example 1 with ClientConfig

use of io.openmessaging.rocketmq.config.ClientConfig in project rocketmq by apache.

the class LocalMessageCacheTest method init.

@Before
public void init() {
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setRmqPullMessageBatchNums(512);
    clientConfig.setRmqPullMessageCacheCapacity(1024);
    localMessageCache = new LocalMessageCache(rocketmqPullConsume, clientConfig);
}
Also used : ClientConfig(io.openmessaging.rocketmq.config.ClientConfig) Before(org.junit.Before)

Example 2 with ClientConfig

use of io.openmessaging.rocketmq.config.ClientConfig in project rocketmq by apache.

the class PullConsumerImplTest method init.

@Before
public void init() throws NoSuchFieldException, IllegalAccessException {
    final MessagingAccessPoint messagingAccessPoint = MessagingAccessPointFactory.getMessagingAccessPoint("openmessaging:rocketmq://IP1:9876,IP2:9876/namespace");
    consumer = messagingAccessPoint.createPullConsumer(queueName, OMS.newKeyValue().put(NonStandardKeys.CONSUMER_GROUP, "TestGroup"));
    Field field = PullConsumerImpl.class.getDeclaredField("rocketmqPullConsumer");
    field.setAccessible(true);
    // Replace
    field.set(consumer, rocketmqPullConsumer);
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setOmsOperationTimeout(200);
    localMessageCache = spy(new LocalMessageCache(rocketmqPullConsumer, clientConfig));
    field = PullConsumerImpl.class.getDeclaredField("localMessageCache");
    field.setAccessible(true);
    field.set(consumer, localMessageCache);
    messagingAccessPoint.startup();
    consumer.startup();
}
Also used : Field(java.lang.reflect.Field) MessagingAccessPoint(io.openmessaging.MessagingAccessPoint) ClientConfig(io.openmessaging.rocketmq.config.ClientConfig) Before(org.junit.Before)

Example 3 with ClientConfig

use of io.openmessaging.rocketmq.config.ClientConfig in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.

the class LocalMessageCacheTest method init.

@Before
public void init() {
    ClientConfig clientConfig = new ClientConfig();
    clientConfig.setRmqPullMessageBatchNums(512);
    clientConfig.setRmqPullMessageCacheCapacity(1024);
    localMessageCache = new LocalMessageCache(rocketmqPullConsume, clientConfig);
}
Also used : ClientConfig(io.openmessaging.rocketmq.config.ClientConfig) Before(org.junit.Before)

Aggregations

ClientConfig (io.openmessaging.rocketmq.config.ClientConfig)3 Before (org.junit.Before)3 MessagingAccessPoint (io.openmessaging.MessagingAccessPoint)1 Field (java.lang.reflect.Field)1