Skip to content

Commit 16e9133

Browse files
authored
fix(notifier): Set the discard notifier with domain connection properties
fix(notifier): Set the discard notifier with domain connection properties
2 parents ac67e8c + 04ff99d commit 16e9133

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

async/async-rabbit-starter-eda/src/main/java/org/reactivecommons/async/rabbit/config/ConnectionManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public void forListener(BiConsumer<String, ReactiveMessageListener> consumer) {
3232
connections.forEach((key, conn) -> consumer.accept(key, conn.getListener()));
3333
}
3434

35-
public void setDiscardNotifierForAll(DiscardNotifier discardNotifier) {
36-
connections.forEach((key, conn) -> conn.setDiscardNotifier(discardNotifier));
35+
public void setDiscardNotifier(String domain, DiscardNotifier discardNotifier) {
36+
getChecked(domain).setDiscardNotifier(discardNotifier);
3737
}
3838

3939
public ConnectionManager addDomain(String domain, ReactiveMessageListener listener, ReactiveMessageSender sender,

async/async-rabbit-starter-eda/src/main/java/org/reactivecommons/async/rabbit/config/RabbitMqConfig.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ public ConnectionManager buildConnectionManager(AsyncPropsDomain props, MessageC
7979
ReactiveMessageSender sender = createMessageSender(provider, properties, converter);
8080
ReactiveMessageListener listener = createMessageListener(provider, properties);
8181
connectionManager.addDomain(domain, listener, sender, provider);
82+
83+
ReactiveMessageSender appDomainSender = connectionManager.getSender(domain);
84+
DomainEventBus appDomainEventBus = new RabbitDomainEventBus(appDomainSender, props.getProps(domain)
85+
.getBrokerConfigProps().getDomainEventsExchangeName(), brokerConfig);
86+
DiscardNotifier notifier = new RabbitDiscardNotifier(appDomainEventBus, objectMapperSupplier.get());
87+
connectionManager.setDiscardNotifier(domain, notifier);
8288
});
83-
ReactiveMessageSender appDomainSender = connectionManager.getSender(DEFAULT_DOMAIN);
84-
DomainEventBus appDomainEventBus = new RabbitDomainEventBus(appDomainSender, props.getProps(DEFAULT_DOMAIN)
85-
.getBrokerConfigProps().getDomainEventsExchangeName(), brokerConfig);
86-
DiscardNotifier notifier = new RabbitDiscardNotifier(appDomainEventBus, objectMapperSupplier.get());
87-
connectionManager.setDiscardNotifierForAll(notifier);
8889
return connectionManager;
8990
}
9091

0 commit comments

Comments
 (0)