fix:事件驱动bug

pull/26/head
le.kuang 2 years ago
parent 9de258af0d
commit 3dc399395c

@ -15,4 +15,22 @@ public class SpringEventBusEvent extends ApplicationEvent {
public String jsonValue;
public String tagId;
public SpringEventBusEvent(Object source, String topic, String jsonValue, String tagId) {
super(source);
this.topic = topic;
this.jsonValue = jsonValue;
this.tagId = tagId;
}
public String getTopic() {
return topic;
}
public String getJsonValue() {
return jsonValue;
}
public String getTagId() {
return tagId;
}
}

@ -25,11 +25,7 @@ public class SpringEventBusSendMqServiceImpl implements SendMqService {
@Override
public void send(String topic, String jsonValue, String tagId) {
SpringEventBusEvent springEventBusEvent = new SpringEventBusEvent();
springEventBusEvent.setTopic(topic);
springEventBusEvent.setJsonValue(jsonValue);
springEventBusEvent.setTagId(tagId);
applicationContext.publishEvent(springEventBusEvent);
applicationContext.publishEvent(new SpringEventBusEvent(this, topic, jsonValue, tagId));
}
@Override

Loading…
Cancel
Save