新增:zhub 广播 broadcast 使用主题同订阅发布

This commit is contained in:
lxy 2021-01-23 11:01:47 +08:00
parent cc67bd2b60
commit 48db458f5e

View File

@ -131,6 +131,14 @@ public abstract class ZHubClient extends AbstractConsumer implements IConsumer,
} }
} }
private <V> String toStr(V v) {
if (v instanceof String) {
return (String) v;
}
return JsonConvert.root().convertTo(v);
}
@Deprecated
public void send(Event t) { public void send(Event t) {
String v = JsonConvert.root().convertTo(t.value); String v = JsonConvert.root().convertTo(t.value);
if (v.startsWith("\"") && v.endsWith("\"")) { if (v.startsWith("\"") && v.endsWith("\"")) {
@ -168,6 +176,7 @@ public abstract class ZHubClient extends AbstractConsumer implements IConsumer,
return true; return true;
} }
@Deprecated
@Override @Override
public void addEventType(EventType... eventType) { public void addEventType(EventType... eventType) {
for (EventType type : eventType) { for (EventType type : eventType) {