本文整理汇总了Java中org.apache.rocketmq.common.protocol.heartbeat.ConsumerData类的典型用法代码示例。如果您正苦于以下问题:Java ConsumerData类的具体用法?Java ConsumerData怎么用?Java ConsumerData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConsumerData类属于org.apache.rocketmq.common.protocol.heartbeat包,在下文中一共展示了ConsumerData类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.rocketmq.common.protocol.heartbeat.ConsumerData; //导入依赖的package包/类
@Before
public void init() {
brokerController.setMessageStore(messageStore);
pullMessageProcessor = new PullMessageProcessor(brokerController);
Channel mockChannel = mock(Channel.class);
when(mockChannel.remoteAddress()).thenReturn(new InetSocketAddress(1024));
when(handlerContext.channel()).thenReturn(mockChannel);
brokerController.getTopicConfigManager().getTopicConfigTable().put(topic, new TopicConfig());
clientChannelInfo = new ClientChannelInfo(mockChannel);
ConsumerData consumerData = createConsumerData(group, topic);
brokerController.getConsumerManager().registerConsumer(
consumerData.getGroupName(),
clientChannelInfo,
consumerData.getConsumeType(),
consumerData.getMessageModel(),
consumerData.getConsumeFromWhere(),
consumerData.getSubscriptionDataSet(),
false);
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:20,代码来源:PullMessageProcessorTest.java
示例2: init
import org.apache.rocketmq.common.protocol.heartbeat.ConsumerData; //导入依赖的package包/类
@Before
public void init() {
when(handlerContext.channel()).thenReturn(channel);
clientManageProcessor = new ClientManageProcessor(brokerController);
clientChannelInfo = new ClientChannelInfo(channel, clientId, LanguageCode.JAVA, 100);
brokerController.getProducerManager().registerProducer(group, clientChannelInfo);
ConsumerData consumerData = createConsumerData(group, topic);
brokerController.getConsumerManager().registerConsumer(
consumerData.getGroupName(),
clientChannelInfo,
consumerData.getConsumeType(),
consumerData.getMessageModel(),
consumerData.getConsumeFromWhere(),
consumerData.getSubscriptionDataSet(),
false);
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:18,代码来源:ClientManageProcessorTest.java
示例3: createConsumerData
import org.apache.rocketmq.common.protocol.heartbeat.ConsumerData; //导入依赖的package包/类
static ConsumerData createConsumerData(String group, String topic) {
ConsumerData consumerData = new ConsumerData();
consumerData.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_FIRST_OFFSET);
consumerData.setConsumeType(ConsumeType.CONSUME_PASSIVELY);
consumerData.setGroupName(group);
consumerData.setMessageModel(MessageModel.CLUSTERING);
Set<SubscriptionData> subscriptionDataSet = new HashSet<>();
SubscriptionData subscriptionData = new SubscriptionData();
subscriptionData.setTopic(topic);
subscriptionData.setSubString("*");
subscriptionData.setSubVersion(100L);
subscriptionDataSet.add(subscriptionData);
consumerData.setSubscriptionDataSet(subscriptionDataSet);
return consumerData;
}
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:16,代码来源:PullMessageProcessorTest.java