Skip to content

Commit

Permalink
fix(notifier): Set the discard notifier with domain connection proper…
Browse files Browse the repository at this point in the history
…ties

fix(notifier): Set the discard notifier with domain connection properties
  • Loading branch information
juancgalvis authored Jul 17, 2024
2 parents ac67e8c + 04ff99d commit 16e9133
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public void forListener(BiConsumer<String, ReactiveMessageListener> consumer) {
connections.forEach((key, conn) -> consumer.accept(key, conn.getListener()));
}

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

public ConnectionManager addDomain(String domain, ReactiveMessageListener listener, ReactiveMessageSender sender,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ public ConnectionManager buildConnectionManager(AsyncPropsDomain props, MessageC
ReactiveMessageSender sender = createMessageSender(provider, properties, converter);
ReactiveMessageListener listener = createMessageListener(provider, properties);
connectionManager.addDomain(domain, listener, sender, provider);

ReactiveMessageSender appDomainSender = connectionManager.getSender(domain);
DomainEventBus appDomainEventBus = new RabbitDomainEventBus(appDomainSender, props.getProps(domain)
.getBrokerConfigProps().getDomainEventsExchangeName(), brokerConfig);
DiscardNotifier notifier = new RabbitDiscardNotifier(appDomainEventBus, objectMapperSupplier.get());
connectionManager.setDiscardNotifier(domain, notifier);
});
ReactiveMessageSender appDomainSender = connectionManager.getSender(DEFAULT_DOMAIN);
DomainEventBus appDomainEventBus = new RabbitDomainEventBus(appDomainSender, props.getProps(DEFAULT_DOMAIN)
.getBrokerConfigProps().getDomainEventsExchangeName(), brokerConfig);
DiscardNotifier notifier = new RabbitDiscardNotifier(appDomainEventBus, objectMapperSupplier.get());
connectionManager.setDiscardNotifierForAll(notifier);
return connectionManager;
}

Expand Down

0 comments on commit 16e9133

Please sign in to comment.