All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.easylib.domainevent.rocketmq.ConsumerCreator Maven / Gradle / Ivy

The newest version!
package cn.easylib.domainevent.rocketmq;

import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
import org.apache.rocketmq.client.consumer.MQPushConsumer;

/**
 * @author lixiaojing
 */
public class ConsumerCreator implements IConsumerCreator {

    private final String nameServer;

    public ConsumerCreator(String nameServer) {
        this.nameServer = nameServer;
    }


    @Override
    public MQPushConsumer create(String consumerGroupName) {
        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(consumerGroupName);
        consumer.setNamesrvAddr(this.nameServer);
        return consumer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy