Search in sources :

Example 1 with Replicator

use of org.apache.rocketmq.connect.jms.Replicator in project rocketmq-externals by apache.

the class RabbitmqSourceTaskTest method getPatternProcessor.

public void getPatternProcessor(Replicator replicator) {
    KeyValue kv = new DefaultKeyValue();
    kv.put("rabbitmqUrl", "amqp://112.74.48.251:5672");
    kv.put("rabbitmqUsername", "admin");
    kv.put("rabbitmqPassword", "admin");
    kv.put("destinationType", "queue");
    kv.put("destinationName", "test-queue");
    RabbitmqConfig config = new RabbitmqConfig();
    config.load(kv);
    replicator = new Replicator(config, null);
    RabbitmqSourceTask task = new RabbitmqSourceTask();
    assertEquals(RabbitMQPatternProcessor.class, task.getPatternProcessor(replicator).getClass());
}
Also used : DefaultKeyValue(io.openmessaging.internal.DefaultKeyValue) KeyValue(io.openmessaging.KeyValue) DefaultKeyValue(io.openmessaging.internal.DefaultKeyValue) RabbitmqConfig(org.apache.rocketmq.connect.rabbitmq.RabbitmqConfig) Replicator(org.apache.rocketmq.connect.jms.Replicator)

Example 2 with Replicator

use of org.apache.rocketmq.connect.jms.Replicator in project rocketmq-externals by apache.

the class RabbitMQPatternProcessorTest method connectionFactory.

@Test
public void connectionFactory() {
    RabbitmqConfig rabbitmqConfig = new RabbitmqConfig();
    rabbitmqConfig.setRabbitmqUrl("amqp://112.74.48.251:5672");
    Replicator replicator = new Replicator(rabbitmqConfig, null);
    RabbitMQPatternProcessor patternProcessor = new RabbitMQPatternProcessor(replicator);
    assertEquals(RMQConnectionFactory.class, patternProcessor.connectionFactory().getClass());
}
Also used : RabbitmqConfig(org.apache.rocketmq.connect.rabbitmq.RabbitmqConfig) Replicator(org.apache.rocketmq.connect.jms.Replicator) Test(org.junit.Test)

Aggregations

Replicator (org.apache.rocketmq.connect.jms.Replicator)2 RabbitmqConfig (org.apache.rocketmq.connect.rabbitmq.RabbitmqConfig)2 KeyValue (io.openmessaging.KeyValue)1 DefaultKeyValue (io.openmessaging.internal.DefaultKeyValue)1 Test (org.junit.Test)1