| | |
| | | @AllArgsConstructor |
| | | public class MyRabbitReceiver { |
| | | private final IAlarmGetService alarmGetService; |
| | | // |
| | | // @RabbitListener(queues = "alarm") |
| | | // public void processMessage(Message message) { |
| | | // System.out.println("收到消息"+new String(message.getBody())); |
| | | // AlarmGet alarmGet = JSONObject.parseObject(new String(message.getBody()), AlarmGet.class); |
| | | // alarmGetService.save(alarmGet); |
| | | // } |
| | | |
| | | @RabbitListener(queues = "alarm") |
| | | public void processMessage(Message message) { |
| | | System.out.println("收到消息"+new String(message.getBody())); |
| | | AlarmGet alarmGet = JSONObject.parseObject(new String(message.getBody()), AlarmGet.class); |
| | | alarmGetService.save(alarmGet); |
| | | } |
| | | |
| | | } |