Search in sources :

Example 6 with RedisEventProcessor

use of org.apache.rocketmq.connect.redis.processor.RedisEventProcessor in project rocketmq-externals by apache.

the class ProcessorTest method getProcessor.

private RedisEventProcessor getProcessor(Config config) {
    RedisEventHandler eventHandler = new DefaultRedisEventHandler(config);
    RedisEventProcessor processor = new DefaultRedisEventProcessor(config);
    processor.registEventHandler(eventHandler);
    return processor;
}
Also used : RedisEventProcessor(org.apache.rocketmq.connect.redis.processor.RedisEventProcessor) DefaultRedisEventProcessor(org.apache.rocketmq.connect.redis.processor.DefaultRedisEventProcessor) RedisEventHandler(org.apache.rocketmq.connect.redis.handler.RedisEventHandler) DefaultRedisEventHandler(org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler) DefaultRedisEventHandler(org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler) DefaultRedisEventProcessor(org.apache.rocketmq.connect.redis.processor.DefaultRedisEventProcessor)

Example 7 with RedisEventProcessor

use of org.apache.rocketmq.connect.redis.processor.RedisEventProcessor in project rocketmq-externals by apache.

the class ListenerTest method getExceptionProcessor.

private RedisEventProcessor getExceptionProcessor(Config config) {
    RedisEventHandler eventHandler = new DefaultRedisEventHandler(config);
    RedisEventProcessor processor = mock(DefaultRedisEventProcessor.class);
    processor.registEventHandler(eventHandler);
    try {
        when(processor.commit(any())).thenThrow(new IllegalStateException("wrong number."));
    } catch (Exception e) {
        e.printStackTrace();
    }
    return processor;
}
Also used : RedisEventProcessor(org.apache.rocketmq.connect.redis.processor.RedisEventProcessor) DefaultRedisEventProcessor(org.apache.rocketmq.connect.redis.processor.DefaultRedisEventProcessor) RedisEventHandler(org.apache.rocketmq.connect.redis.handler.RedisEventHandler) DefaultRedisEventHandler(org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler) DefaultRedisEventHandler(org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler) IOException(java.io.IOException)

Example 8 with RedisEventProcessor

use of org.apache.rocketmq.connect.redis.processor.RedisEventProcessor in project rocketmq-externals by apache.

the class ProcessorTest method testSyncMod.

@Test
public void testSyncMod() throws IOException {
    RedisEventProcessor processor = null;
    try {
        processor = getProcessor(SyncMod.LAST_OFFSET_FORCE);
        processor.start();
        processor = getProcessor(SyncMod.CUSTOM_OFFSET_FORCE);
        processor.start();
        processor = getProcessor(SyncMod.LAST_OFFSET);
        processor.start();
        processor = getProcessor(SyncMod.CUSTOM_OFFSET);
        processor.start();
    } catch (JedisConnectionException e) {
    }
}
Also used : RedisEventProcessor(org.apache.rocketmq.connect.redis.processor.RedisEventProcessor) DefaultRedisEventProcessor(org.apache.rocketmq.connect.redis.processor.DefaultRedisEventProcessor) JedisConnectionException(redis.clients.jedis.exceptions.JedisConnectionException) Test(org.junit.Test)

Aggregations

DefaultRedisEventProcessor (org.apache.rocketmq.connect.redis.processor.DefaultRedisEventProcessor)8 RedisEventProcessor (org.apache.rocketmq.connect.redis.processor.RedisEventProcessor)8 DefaultRedisEventHandler (org.apache.rocketmq.connect.redis.handler.DefaultRedisEventHandler)4 RedisEventHandler (org.apache.rocketmq.connect.redis.handler.RedisEventHandler)4 Test (org.junit.Test)4 Config (org.apache.rocketmq.connect.redis.common.Config)3 EventListener (com.moilioncircle.redis.replicator.event.EventListener)2 KeyStringValueString (com.moilioncircle.redis.replicator.rdb.datatype.KeyStringValueString)2 KeyValuePair (com.moilioncircle.redis.replicator.rdb.datatype.KeyValuePair)2 IOException (java.io.IOException)2 RedisEventListener (org.apache.rocketmq.connect.redis.processor.RedisEventListener)2 JedisConnectionException (redis.clients.jedis.exceptions.JedisConnectionException)2 RedisSourceTask (org.apache.rocketmq.connect.redis.connector.RedisSourceTask)1