赞
踩
subscribeTable
和 subscriptionInner
方法中,是使用 Map 集合的方式存储topic订阅者大概
为 {group : topic}
subscribeTable
和 subscriptionInner
方法存储的 Keyrocketmq:
name-server: 192.168.112.140:9876
producer:
group: member_synchronization_group
@Service
@RocketMQMessageListener(topic = "mysql-redis-topic", consumerGroup = "member_synchronization_group")
public class MemberListener implements RocketMQListener<String> {
@Autowired
private RedisUtil redisUtil;
@Override
public void onMessage(String message) {
System.out.println("接收消息:" + message);
}
}
rocketmq:
name-server: 192.168.112.140:9876
producer:
group: goods_synchronization_group
@Service
@RocketMQMessageListener(topic = "mysql-redis-topic", consumerGroup = "goods_synchronization_group")
public class GoodsListener implements RocketMQListener<String> {
@Autowired
private RedisUtil redisUtil;
@Override
public void onMessage(String message) {
System.out.println(message);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。