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

org.reactivecommons.async.kafka.KafkaDomainEventBus Maven / Gradle / Ivy

There is a newer version: 5.2.2
Show newest version
package org.reactivecommons.async.kafka;

import io.cloudevents.CloudEvent;
import lombok.AllArgsConstructor;
import org.reactivecommons.api.domain.DomainEvent;
import org.reactivecommons.api.domain.DomainEventBus;
import org.reactivecommons.async.kafka.communications.ReactiveMessageSender;
import org.reactivestreams.Publisher;

@AllArgsConstructor
public class KafkaDomainEventBus implements DomainEventBus {
    public static final String NOT_IMPLEMENTED_YET = "Not implemented yet";
    private final ReactiveMessageSender sender;

    @Override
    public  Publisher emit(DomainEvent event) {
        return sender.send(event);
    }

    @Override
    public  Publisher emit(String domain, DomainEvent event) {
        throw new UnsupportedOperationException(NOT_IMPLEMENTED_YET);
    }

    @Override
    public Publisher emit(CloudEvent event) {
        return sender.send(event);
    }

    @Override
    public Publisher emit(String domain, CloudEvent event) {
        throw new UnsupportedOperationException(NOT_IMPLEMENTED_YET);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy