fix(): 优化上下线监听

dev.entOperation
xinzirun 2024-10-07 13:55:46 +08:00
parent 7fa71097fd
commit 26c0d3d4c8
2 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package com.muyu.event.process.consumer;
import com.muyu.event.process.util.CacheUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
@ -32,7 +33,7 @@ public class GoOfflineConsumer {
@RabbitListener(
bindings = @QueueBinding(
value = @Queue(value = "GO_OFFLINE", durable = "true"),
exchange = @Exchange(value = "OFFLINE_EXCHANGE", type = "fanout")
exchange = @Exchange(value = "OFFLINE_EXCHANGE", type = ExchangeTypes.FANOUT)
)
)
public void offline(String vin) {

View File

@ -8,6 +8,7 @@ import com.muyu.event.process.constant.CacheHandlerConstants;
import com.muyu.event.process.util.CacheUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
@ -19,7 +20,7 @@ import java.util.HashMap;
/**
* @Author: zi run
* @Date 2024/10/6 10:01
* @Description 线
* @Description 线
*/
@Slf4j
@Component
@ -53,12 +54,13 @@ public class GoOnlineConsumer {
/**
* 线
*
* @param vin
*/
@RabbitListener(
bindings = @QueueBinding(
value = @Queue(value = "GO_ONLINE", durable = "true"),
exchange = @Exchange(value = "ONLINE_EXCHANGE", type = "fanout")
exchange = @Exchange(value = "ONLINE_EXCHANGE", type = ExchangeTypes.FANOUT)
)
)
public void online(String vin) {