This commit is contained in:
lxy 2020-09-17 21:24:34 +08:00
parent 8d22d5e830
commit e104268952

View File

@ -16,7 +16,13 @@ public abstract class AbstractConsumer implements IConsumer {
public void addEventType(EventType... eventType) {
for (EventType type : eventType) {
eventMap.put(type.topic, type);
String[] topics = type.topic.split(",");
for (String topic : topics) {
if (topic.isEmpty()) {
continue;
}
eventMap.put(topic, type);
}
}
}
@ -30,7 +36,7 @@ public abstract class AbstractConsumer implements IConsumer {
EventType eventType = eventMap.get(topic);
Object data = null;
if ("java.lang.String".equals(eventType.typeToken.getType().toString())) {
if ("java.lang.String".equals(eventType.typeToken.getType().getTypeName())) {
data = value;
} else {
data = JsonConvert.root().convertFrom(eventType.typeToken.getType(), value);