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

de.otto.synapse.endpoint.receiver.MessageQueueReceiverEndpoint Maven / Gradle / Ivy

Go to download

A library used at otto.de to implement Spring Boot based event-sourcing microservices.

There is a newer version: 0.33.1
Show newest version
package de.otto.synapse.endpoint.receiver;

import de.otto.synapse.consumer.MessageConsumer;
import de.otto.synapse.consumer.MessageDispatcher;
import de.otto.synapse.message.Message;
import de.otto.synapse.message.TextMessage;

import java.util.concurrent.CompletableFuture;

/**
 * Receiver-side {@code MessageEndpoint endpoint} of a Message Channel with Queue or FIFO semantics.
 *
 * 

* Message Endpoint *

*

* {@code MessageQueueReceiverEndpoints} are Message Endpoints for Point-to-Point Channels: *

*

* Point-to-Point Channel *

* * @see EIP: Message Endpoint * @see EIP: Point-to-Point Channel */ public interface MessageQueueReceiverEndpoint extends MessageReceiverEndpoint { /** * Takes zero or more messages from the channel, calls {@link #intercept(TextMessage)} for every message, and notifies * the registered consumers with the intercepted message, or drops the message, if {@code intercept} returns null. * *

* Consumption starts with the earliest available and not-yet-consumed message and finishes when either the * {@code stopCondition} is met, or the application is shutting down. *

*

* The {@link #register(MessageConsumer) registered} {@link MessageConsumer consumers} are used as a * callback for consumed messages. A {@link MessageDispatcher} can be used as a consumer, if multiple * consumers, or consumers with {@link Message#getPayload() message payloads} other than {@code String} are * required. *

* @return completable future that can be used to {@link CompletableFuture#join() wait} until the endpoint has * stopped message consumption. */ CompletableFuture consume(); /** * Stops consumption of messages and shuts down the {@code MessageQueueReceiverEndpoint}. */ void stop(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy