refactor(CanalListener.java): Canal队列调整动态创建

This commit is contained in:
郝先瑞 2022-04-04 21:42:57 +08:00
parent 8dcc4af291
commit 2c34c4272c

View File

@ -30,13 +30,14 @@ public class CanalListener {
private final ISysOauthClientService oauthClientService; private final ISysOauthClientService oauthClientService;
private final ISysMenuService menuService; private final ISysMenuService menuService;
@RabbitListener(bindings = { /*@RabbitListener(bindings = {
@QueueBinding( @QueueBinding(
value = @Queue(value = "canal.queue", durable = "true"), value = @Queue(value = "canal.queue", durable = "true"),
exchange = @Exchange(value = "canal.exchange"), exchange = @Exchange(value = "canal.exchange"),
key = "canal.routing.key" key = "canal.routing.key"
) )
}) })*/
@RabbitListener(queues = "canal.queue")
public void handleDataChange(String message) { public void handleDataChange(String message) {
CanalMessage canalMessage = JSONUtil.toBean(message, CanalMessage.class); CanalMessage canalMessage = JSONUtil.toBean(message, CanalMessage.class);
String tableName = canalMessage.getTable(); String tableName = canalMessage.getTable();