| | |
| | | } |
| | | } |
| | | |
| | | System.out.println(message); |
| | | System.out.println(JSON.toJSONString(msgData)); |
| | | // System.out.println(message); |
| | | // System.out.println(JSON.toJSONString(msgData)); |
| | | |
| | | rabbitTemplate.convertAndSend("monitors_data_2", "", JSON.toJSONString(msgData).getBytes()); |
| | | // rabbitTemplate.convertAndSend("monitors_data", "", JSON.toJSONString(msgData).getBytes()); |
| | | // rabbitTemplate.send("monitors_data_3", "", new Message(JSON.toJSONString(msgData).getBytes(), new MessageProperties())); |
| | | |
| | | int state = (new Random()).nextInt(4) % 5; |
| | | rabbitTemplate.convertAndSend("monitors_alarm", "", "{\"mac\": \"" + mac + "\", \"state\": " + state + "}"); |
| | | // rabbitTemplate.convertAndSend("monitors_alarm", "", "{\"mac\": \"" + mac + "\", \"state\": " + state + "}"); |
| | | |
| | | jobDao.updateStateByMac(mac, state); |
| | | } |