All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.reactivecommons.async.rabbit.standalone.config.EventBusConfig Maven / Gradle / Ivy

The newest version!
package org.reactivecommons.async.rabbit.standalone.config;

import org.reactivecommons.api.domain.DomainEventBus;
import org.reactivecommons.async.rabbit.RabbitDomainEventBus;
import org.reactivecommons.async.rabbit.communications.ReactiveMessageSender;

import static reactor.rabbitmq.ExchangeSpecification.exchange;

public class EventBusConfig {

    private String domainEventsExchangeName;

    public EventBusConfig(String domainEventsExchangeName) {
        this.domainEventsExchangeName = domainEventsExchangeName;
    }

    public DomainEventBus domainEventBus(ReactiveMessageSender sender) {
        sender.getTopologyCreator().declare(exchange(domainEventsExchangeName).durable(true).type("topic")).subscribe();
        return new RabbitDomainEventBus(sender, domainEventsExchangeName);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy