From 2163498e05bdadbf403f3619938f5be4064feb99 Mon Sep 17 00:00:00 2001 From: aoshiguchen <1052045476@qq.com> Date: Mon, 10 Oct 2022 21:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=BA=94=E7=94=A8=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=9B=91=E5=90=AC=E6=A0=B9=E6=8D=AEtopic=E3=80=81tag?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/java/fun/asgc/neutrino/core/base/event/Test3.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neutrino-core/src/test/java/fun/asgc/neutrino/core/base/event/Test3.java b/neutrino-core/src/test/java/fun/asgc/neutrino/core/base/event/Test3.java index a4ca0477..7b50e05b 100644 --- a/neutrino-core/src/test/java/fun/asgc/neutrino/core/base/event/Test3.java +++ b/neutrino-core/src/test/java/fun/asgc/neutrino/core/base/event/Test3.java @@ -22,6 +22,7 @@ package fun.asgc.neutrino.core.base.event; import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Sets; import fun.asgc.neutrino.core.util.SystemUtil; import lombok.Data; import lombok.experimental.Accessors; @@ -51,16 +52,18 @@ public class Test3 { } }; receiver1.setTopic("/*"); + receiver1.setTags(Sets.newHashSet("tag1")); ApplicationEventReceiver receiver2 = new ApplicationEventReceiver() { @Override public void receive(ApplicationEvent msg) { log.info("receiver2 data:{}", JSONObject.toJSONString(msg.data())); } }; + receiver2.setTags(Sets.newHashSet("tag2")); simpleApplicationEventManager.registerReceiver(receiver1); simpleApplicationEventManager.registerReceiver(receiver2); - simpleApplicationEventManager.publish("/aaa", null, new Student().setId("1").setName("张三").setAge(28).setSex("男")); + simpleApplicationEventManager.publish("/aaa", Sets.newHashSet("tag2"), new Student().setId("1").setName("张三").setAge(28).setSex("男")); SystemUtil.waitProcessDestroy().sync(); }