|
@@ -7,17 +7,20 @@ import org.springframework.amqp.core.ExchangeTypes;
|
|
|
import org.springframework.amqp.core.Message;
|
|
|
import org.springframework.amqp.rabbit.annotation.*;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
@Slf4j
|
|
|
@Component
|
|
|
public class RabbitMQListener {
|
|
|
+
|
|
|
@Autowired
|
|
|
private patrolAgbox PatrolAgbox;
|
|
|
@RabbitHandler
|
|
|
@RabbitListener(bindings = @QueueBinding(
|
|
|
value = @Queue(),
|
|
|
- exchange = @Exchange(value = "Patrol_FEvent",type = ExchangeTypes.FANOUT)
|
|
|
+ exchange = @Exchange(value = "Patrol_EEvent"),
|
|
|
+ key = {"${agBox.routeKey}"}
|
|
|
))
|
|
|
public void getData(Message message){
|
|
|
try {
|
|
@@ -52,7 +55,8 @@ public class RabbitMQListener {
|
|
|
@RabbitHandler
|
|
|
@RabbitListener(bindings = @QueueBinding(
|
|
|
value = @Queue(),
|
|
|
- exchange = @Exchange(value = "Patrol_FInfo",type = ExchangeTypes.FANOUT)
|
|
|
+ exchange = @Exchange(value = "Patrol_EInfo"),
|
|
|
+ key = {"${agBox.routeKey}"}
|
|
|
))
|
|
|
public void getDataInfo(Message message){
|
|
|
try {
|