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

de.otto.synapse.annotation.EnableMessageLogReceiverEndpoint 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.annotation;

import de.otto.synapse.channel.selector.MessageLog;
import de.otto.synapse.configuration.MessageLogReceiverEndpointAutoConfiguration;
import de.otto.synapse.endpoint.receiver.MessageLogReceiverEndpoint;
import de.otto.synapse.endpoint.receiver.MessageLogReceiverEndpointFactory;
import org.springframework.context.annotation.Import;

import java.lang.annotation.*;


@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import({MessageLogReceiverEndpointBeanRegistrar.class, MessageLogReceiverEndpointAutoConfiguration.class})
@Repeatable(EnableMessageLogReceiverEndpoints.class)
public @interface EnableMessageLogReceiverEndpoint {

    /**
     * The name of the message-log channel.
     * 

* Resolving placeholders like "${my.channel.name}" is supported for this property. *

* * @return channel name */ String channelName(); /** * The name of the registered MessageLogReceiverEndpoint bean. *

* If {@code #name} is not set, the name of the bean is derived from the name of the message channel. The name * is constructed by tranforming hyphenated variable naming convention, e.g., "my-channel" into * the Spring bean naming convention, e.g., "myChannel". After this conversion, the string * "MessageLogReceiverEndpoint" is appended. A channel named "my-channel" will therefore result in a bean name * "myChannelMessageLogReceiverEndpoint". *

* * @return bean name */ String name() default ""; /** * Specifies where to start reading from the message log. *

Possible Values:

*
    *
  • HORIZON (default): Start reading from the oldest available message
  • *
  • LATEST: Start reading from the latest message
  • *
* * @return LATEST or HORIZON */ String startFrom() default "HORIZON"; /** * Selector used to select one of possibly multiple available * {@link MessageLogReceiverEndpointFactory} instances used to * create the {@link MessageLogReceiverEndpoint}. * *

* Example: the KafkaMessageLogReceiverEndpointFactory matches both {@link MessageLog MessageLog.class} * and Kafka.class. The following usage of the annotation is selecting the KafkaMessageLogReceiverEndpointFactory * using the more specific Kafka selector: *

*

     * {@literal @}Configuration
     * {@literal @}EnableMessageLogReceiverEndpoint(
     *      channelName = "some-log",
     *      selector = Kafka.class)
     * class MyExampleConfiguration {
     * }
     * 
* * @return MessageLog selector class */ Class selector() default MessageLog.class; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy