优化group

This commit is contained in:
redkale
2023-10-05 21:22:06 +08:00
parent b8d5800434
commit a71544a78d

View File

@@ -216,7 +216,9 @@ public abstract class MessageAgent implements Resourcable {
for (MessageConsumer consumer : consumers) {
ResourceConsumer res = consumer.getClass().getAnnotation(ResourceConsumer.class);
String group = application.getPropertyValue(res.group());
group = consumer.getClass().getName() + (group.isEmpty() ? "" : ("-" + group));
if (Utility.isBlank(group)) {
group = consumer.getClass().getName();
}
Map<String, MessageConsumerWrapper> map = maps.computeIfAbsent(group, g -> new HashMap<>());
for (String t : res.topics()) {
String topic = application.getPropertyValue(t);