Annotation Type EnableEventSource
-
@Target(TYPE) @Retention(RUNTIME) @Documented @Import(EventSourceBeanRegistrar.class) @Repeatable(EnableEventSources.class) @EnableEventSourcing public @interface EnableEventSource
Enables auto-configuration ofevent sources.A Spring bean with type
EventSourceis registered at the ApplicationContext. The name of the beans can be specified byname().EventSources are created using a
EventSourceBuilderthat must be registered in theApplicationContext. The default builder is configured inSynapseAutoConfigurationand will create instances ofDefaultEventSource.Because the
EventSourceBuilderis annotated asConditionalOnMissingBean, it can be replaced by other implementations by just registering a different bean.The
EventSource.getChannelName()is configured usingchannelName().
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringchannelNameThe name of the message channel.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringmessageLogReceiverEndpointThe name of theMessageLogReceiverEndpointbean that is used to create theEventSourcebean.java.lang.StringnameThe name of the registered EventSource bean.java.lang.Class<? extends MessageLog>selectorSelector used to select one of possibly multiple availableMessageLogReceiverEndpointFactoryinstances used to create theMessageLogReceiverEndpointof the EventSource.
-
-
-
-
name
java.lang.String name
The name of the registered EventSource bean.If
#nameis 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 "EventSource" is appended. A channel named "my-channel" will therefore result in a bean name "myChannelEventSource".- Returns:
- bean name
- Default:
- ""
-
-
-
messageLogReceiverEndpoint
java.lang.String messageLogReceiverEndpoint
The name of theMessageLogReceiverEndpointbean that is used to create theEventSourcebean.If
messageLogReceiverEndpointis 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".The
EventSourceBeanRegistraris responsible for creating theEventSourcesspecified by this annotation. The bean name, either specified or derived from thechannelName, will be used by theEventSourceBeanRegistraras the name of the registered message log bean. If a bean having this name already exists, aBeanCreationExceptionwill be thrown during startup.- Returns:
- bean name of the
MessageLogReceiverEndpoint
- Default:
- ""
-
-
-
selector
java.lang.Class<? extends MessageLog> selector
Selector used to select one of possibly multiple availableMessageLogReceiverEndpointFactoryinstances used to create theMessageLogReceiverEndpointof the EventSource.Example: the KafkaMessageLogReceiverEndpointFactory matches both
MessageLog.classand Kafka.class. The following usage of the annotation is selecting the KafkaMessageLogReceiverEndpointFactory using the more specific Kafka selector:@Configuration @EnableEventSource( channelName = "some-log", selector = Kafka.class) class MyExampleConfiguration { }- Returns:
- MessageLog selector class
- Default:
- de.otto.synapse.channel.selector.MessageLog.class
-
-