spring-integration / org.springframework.integration.dsl / KotlinIntegrationFlowDefinition

KotlinIntegrationFlowDefinition

class KotlinIntegrationFlowDefinition

An IntegrationFlowDefinition wrapped for Kotlin DSL.

Constructors

<init>

An IntegrationFlowDefinition wrapped for Kotlin DSL.

KotlinIntegrationFlowDefinition(delegate: IntegrationFlowDefinition<*>)

Functions

aggregate

Populate the AggregatingMessageHandler with provided options from AggregatorSpec. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun aggregate(aggregator: AggregatorSpec.() -> Unit = {}): Unit

barrier

Populate a org.springframework.integration.aggregator.BarrierMessageHandler instance for provided timeout and options from BarrierSpec and endpoint options from GenericEndpointSpec.

fun barrier(timeout: Long, barrierConfigurer: BarrierSpec.() -> Unit = {}): Unit

bridge

Populate a BridgeHandler to the current integration flow position.

fun bridge(endpointConfigurer: GenericEndpointSpec<BridgeHandler>.() -> Unit = {}): Unit

channel

Populate a MessageChannelReference instance at the current IntegrationFlow chain position. The provided messageChannelName is used for the bean registration (org.springframework.integration.channel.DirectChannel), if there is no such a bean in the application context. Otherwise the existing MessageChannel bean is used to wire integration endpoints.

fun channel(messageChannelName: String): Unit

Populate a MessageChannel instance at the current IntegrationFlow chain position using the MessageChannelSpec fluent API.

fun channel(messageChannelSpec: MessageChannelSpec<*, *>): Unit

Populate the provided MessageChannel instance at the current IntegrationFlow chain position. The messageChannel can be an existing bean, or fresh instance, in which case the org.springframework.integration.dsl.context.IntegrationFlowBeanPostProcessor will populate it as a bean with a generated name.

fun channel(messageChannel: MessageChannel): Unit

Populate a MessageChannel instance at the current IntegrationFlow chain position using the Channels factory fluent API.

fun channel(channels: Channels.() -> MessageChannelSpec<*, *>): Unit

claimCheckIn

Populate the MessageTransformingHandler for the ClaimCheckInTransformer with provided MessageStore. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun claimCheckIn(messageStore: MessageStore, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

claimCheckOut

Populate the MessageTransformingHandler for the ClaimCheckOutTransformer with provided MessageStore and removeMessage flag.

fun claimCheckOut(messageStore: MessageStore, removeMessage: Boolean = false): Unit

Populate the MessageTransformingHandler for the ClaimCheckOutTransformer with provided MessageStore and removeMessage flag. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun claimCheckOut(messageStore: MessageStore, removeMessage: Boolean, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit): Unit

controlBus

Populate the Control Bus EI Pattern specific MessageHandler implementation at the current IntegrationFlow chain position.

fun controlBus(endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit = {}): Unit

convert

Inline function for IntegrationFlowDefinition.convert providing a convert<MyType>() variant with reified generic type.

fun <T> convert(configurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

delay

Populate a DelayHandler to the current integration flow position.

fun delay(groupId: String, endpointConfigurer: DelayerEndpointSpec.() -> Unit = {}): Unit

enrich

Populate a org.springframework.integration.transformer.ContentEnricher to the current integration flow position with provided options.

fun enrich(enricherConfigurer: KotlinEnricherSpec.() -> Unit): Unit

enrichHeaders

Populate a MessageTransformingHandler for a org.springframework.integration.transformer.HeaderEnricher using header values from provided MapBuilder. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun enrichHeaders(headers: MapBuilder<*, String, Any>, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

Accept a Map of values to be used for the Message header enrichment. values can apply an Expression to be evaluated against a request Message.

fun enrichHeaders(headers: Map<String, Any>, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

Populate a MessageTransformingHandler for a org.springframework.integration.transformer.HeaderEnricher as the result of provided consumer.

fun enrichHeaders(headerEnricherConfigurer: HeaderEnricherSpec.() -> Unit): Unit

filter

Inline function for IntegrationFlowDefinition.filter providing a filter<MyTypeIn>() variant with reified generic type.

fun <P> filter(function: (P) -> Boolean): Unit
fun <P> filter(function: (P) -> Boolean, filterConfigurer: KotlinFilterEndpointSpec.() -> Unit): Unit

Populate a MessageFilter with MessageSelector for the provided SpEL expression. In addition accept options for the integration endpoint using KotlinFilterEndpointSpec:

fun filter(expression: String, filterConfigurer: KotlinFilterEndpointSpec.() -> Unit = {}): Unit

Populate a MessageFilter with MethodInvokingSelector for the method of the provided service.

fun filter(service: Any, methodName: String? = null): Unit
fun filter(service: Any, methodName: String?, filterConfigurer: KotlinFilterEndpointSpec.() -> Unit): Unit

Populate a MessageFilter with MethodInvokingSelector for the MessageProcessor from the provided MessageProcessorSpec. In addition accept options for the integration endpoint using KotlinFilterEndpointSpec.

fun filter(messageProcessorSpec: MessageProcessorSpec<*>, filterConfigurer: KotlinFilterEndpointSpec.() -> Unit = {}): Unit

Populate a MessageFilter with the provided MessageSelector. In addition accept options for the integration endpoint using KotlinFilterEndpointSpec.

fun filter(messageSelector: MessageSelector, filterConfigurer: KotlinFilterEndpointSpec.() -> Unit = {}): Unit

fixedSubscriberChannel

Populate an org.springframework.integration.channel.FixedSubscriberChannel instance at the current IntegrationFlow chain position. The provided messageChannelName is used for the bean registration.

fun fixedSubscriberChannel(messageChannelName: String? = null): Unit

fluxTransform

Populate a FluxMessageChannel to start a reactive processing for upstream data, wrap it to a Flux, apply provided function via Flux.transform and emit the result to one more FluxMessageChannel, subscribed in the downstream flow.

fun <I, O> fluxTransform(fluxFunction: (Flux<Message<I>>) -> Publisher<O>): Unit

gateway

Populate the "artificial" org.springframework.integration.gateway.GatewayMessageHandler for the provided requestChannel to send a request with options from GatewayEndpointSpec. Uses org.springframework.integration.gateway.RequestReplyExchanger Proxy on the background.

fun gateway(requestChannel: String, endpointConfigurer: GatewayEndpointSpec.() -> Unit = {}): Unit
fun gateway(requestChannel: MessageChannel, endpointConfigurer: GatewayEndpointSpec.() -> Unit = {}): Unit

Populate the "artificial" org.springframework.integration.gateway.GatewayMessageHandler for the provided subflow with options from GatewayEndpointSpec.

fun gateway(flow: KotlinIntegrationFlowDefinition.() -> Unit): Unit
fun gateway(endpointConfigurer: GatewayEndpointSpec.() -> Unit, flow: KotlinIntegrationFlowDefinition.() -> Unit): Unit

handle

Populate a ServiceActivatingHandler for the selected protocol specific MessageHandler implementation from Namespace Factory:

fun <H : MessageHandler?> handle(messageHandlerSpec: MessageHandlerSpec<*, H>): Unit

Populate a ServiceActivatingHandler for the provided MessageHandler implementation.

fun handle(messageHandler: MessageHandler): Unit

Populate a ServiceActivatingHandler for the org.springframework.integration.handler.MethodInvokingMessageProcessor to invoke the method for provided bean at runtime.

fun handle(beanName: String, methodName: String? = null): Unit

Populate a ServiceActivatingHandler for the org.springframework.integration.handler.MethodInvokingMessageProcessor to invoke the method for provided bean at runtime. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun handle(beanName: String, methodName: String?, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit): Unit
fun handle(service: Any, methodName: String? = null): Unit
fun handle(service: Any, methodName: String?, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit): Unit

Populate a ServiceActivatingHandler for the org.springframework.integration.handler.MethodInvokingMessageProcessor to invoke the provided GenericHandler at runtime.

fun <P> handle(handler: (P, MessageHeaders) -> Any): Unit

Populate a ServiceActivatingHandler for the org.springframework.integration.handler.MethodInvokingMessageProcessor to invoke the provided GenericHandler at runtime. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun <P> handle(handler: (P, MessageHeaders) -> Any, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit): Unit

Populate a ServiceActivatingHandler for the MessageProcessor from the provided MessageProcessorSpec. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun handle(messageProcessorSpec: MessageProcessorSpec<*>, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit = {}): Unit

Populate a ServiceActivatingHandler for the selected protocol specific MessageHandler implementation from Namespace Factory: In addition accept options for the integration endpoint using GenericEndpointSpec.

fun <H : MessageHandler> handle(messageHandlerSpec: MessageHandlerSpec<*, H>, endpointConfigurer: GenericEndpointSpec<H>.() -> Unit = {}): Unit

Populate a ServiceActivatingHandler for the provided MessageHandler lambda.

fun handle(messageHandler: (Message<*>) -> Unit): Unit

Populate a ServiceActivatingHandler for the provided MessageHandler lambda. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun handle(messageHandler: (Message<*>) -> Unit, endpointConfigurer: GenericEndpointSpec<MessageHandler>.() -> Unit): Unit

Populate a ServiceActivatingHandler for the provided MessageHandler implementation. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun <H : MessageHandler> handle(messageHandler: H, endpointConfigurer: GenericEndpointSpec<H>.() -> Unit = {}): Unit

headerFilter

Provide the HeaderFilter to the current IntegrationFlow.

fun headerFilter(headersToRemove: String, patternMatch: Boolean = true): Unit

Populate the provided MessageTransformingHandler for the provided HeaderFilter.

fun headerFilter(headerFilter: HeaderFilter, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit): Unit

log

Populate a WireTap for the current channel with the LoggingHandler subscriber for the INFO logging level and org.springframework.integration.handler.LoggingHandler as a default logging category.

fun log(): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for provided LoggingHandler.Level logging level and org.springframework.integration.handler.LoggingHandler as a default logging category.

fun log(level: Level, category: String? = null): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the provided logging category and INFO logging level.

fun log(category: String): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the provided LoggingHandler.Level logging level, logging category and SpEL expression for the log message.

fun log(level: Level, category: String, logExpression: String): Unit
fun log(level: Level, category: String, logExpression: Expression): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the INFO logging level, the org.springframework.integration.handler.LoggingHandler as a default logging category and function for the log message.

fun <P> log(function: (Message<P>) -> Any): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the INFO logging level, the org.springframework.integration.handler.LoggingHandler as a default logging category and SpEL expression to evaluate logger message at runtime against the request Message.

fun log(logExpression: Expression): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the provided LoggingHandler.Level logging level, the org.springframework.integration.handler.LoggingHandler as a default logging category and SpEL expression to evaluate logger message at runtime against the request Message. When this operator is used in the end of flow, it is treated as one-way handler without any replies to continue.

fun log(level: Level, logExpression: Expression): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the INFO LoggingHandler.Level logging level, the provided logging category and SpEL expression to evaluate logger message at runtime against the request Message.

fun log(category: String, logExpression: Expression): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the provided LoggingHandler.Level logging level, the org.springframework.integration.handler.LoggingHandler as a default logging category and function for the log message.

fun <P> log(level: Level, function: (Message<P>) -> Any): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the provided LoggingHandler.Level logging level, the provided logging category and function for the log message.

fun <P> log(category: String, function: (Message<P>) -> Any): Unit

Populate a WireTap for the current channel with the LoggingHandler subscriber for the provided LoggingHandler.Level logging level, logging category and function for the log message.

fun <P> log(level: Level, category: String, function: (Message<P>) -> Any): Unit

publishSubscribe

The org.springframework.integration.channel.BroadcastCapableChannel channel() method specific implementation to allow the use of the 'subflow' subscriber capability.

fun publishSubscribe(broadcastCapableChannel: BroadcastCapableChannel, vararg subscribeSubFlows: KotlinIntegrationFlowDefinition.() -> Unit): Unit

resequence

Populate the org.springframework.integration.aggregator.ResequencingMessageHandler with provided options from ResequencerSpec. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun resequence(resequencer: ResequencerSpec.() -> Unit = {}): Unit

route

Inline function for IntegrationFlowDefinition.filter providing a filter<MyTypeIn>() variant with reified generic type.

fun <P> route(function: (P) -> Any?): Unit
fun <P, T> route(function: (P) -> T, configurer: KotlinRouterSpec<T, MethodInvokingRouter>.() -> Unit): Unit

Populate the MethodInvokingRouter for provided bean and its method with default options.

fun route(beanName: String, method: String? = null): Unit

Populate the MethodInvokingRouter for provided bean and its method with provided options from KotlinRouterSpec.

fun route(beanName: String, method: String?, routerConfigurer: KotlinRouterSpec<Any, MethodInvokingRouter>.() -> Unit): Unit

Populate the MethodInvokingRouter for the method of the provided service and its method with default options.

fun route(service: Any, methodName: String? = null): Unit

Populate the MethodInvokingRouter for the method of the provided service and its method with provided options from KotlinRouterSpec.

fun route(service: Any, methodName: String?, routerConfigurer: KotlinRouterSpec<Any, MethodInvokingRouter>.() -> Unit): Unit

Populate the ExpressionEvaluatingRouter for provided SpEL expression with provided options from KotlinRouterSpec.

fun <T> route(expression: String, routerConfigurer: KotlinRouterSpec<T, ExpressionEvaluatingRouter>.() -> Unit = {}): Unit

Populate the MethodInvokingRouter for the MessageProcessor from the provided MessageProcessorSpec with default options.

fun route(messageProcessorSpec: MessageProcessorSpec<*>, routerConfigurer: KotlinRouterSpec<Any, MethodInvokingRouter>.() -> Unit = {}): Unit

Populate the provided AbstractMessageRouter implementation to the current integration flow position. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun <R : AbstractMessageRouter?> route(router: R, endpointConfigurer: GenericEndpointSpec<R>.() -> Unit = {}): Unit

routeByException

Populate the ErrorMessageExceptionTypeRouter with options from the KotlinRouterSpec.

fun routeByException(routerConfigurer: KotlinRouterSpec<Class<out Throwable>, ErrorMessageExceptionTypeRouter>.() -> Unit): Unit

routeToRecipients

Populate the RecipientListRouter with options from the KotlinRecipientListRouterSpec.

fun routeToRecipients(routerConfigurer: KotlinRecipientListRouterSpec.() -> Unit): Unit

scatterGather

Populate a ScatterGatherHandler to the current integration flow position based on the provided MessageChannel for scattering function and AggregatorSpec for gathering function.

fun scatterGather(scatterChannel: MessageChannel, gatherer: AggregatorSpec.() -> Unit = {}): Unit
fun scatterGather(scatterChannel: MessageChannel, gatherer: AggregatorSpec.() -> Unit, scatterGather: ScatterGatherSpec.() -> Unit): Unit

Populate a ScatterGatherHandler to the current integration flow position based on the provided KotlinRecipientListRouterSpec for scattering function and default AggregatorSpec for gathering function.

fun scatterGather(scatterer: KotlinRecipientListRouterSpec.() -> Unit): Unit

Populate a ScatterGatherHandler to the current integration flow position based on the provided KotlinRecipientListRouterSpec for scattering function and AggregatorSpec for gathering function.

fun scatterGather(scatterer: KotlinRecipientListRouterSpec.() -> Unit, gatherer: AggregatorSpec.() -> Unit): Unit
fun scatterGather(scatterer: KotlinRecipientListRouterSpec.() -> Unit, gatherer: AggregatorSpec.() -> Unit, scatterGather: ScatterGatherSpec.() -> Unit): Unit

split

Inline function for IntegrationFlowDefinition.split providing a split<MyTypeIn>() variant with reified generic type.

fun <P> split(function: (P) -> Any): Unit
fun <P> split(function: (P) -> Any, configurer: KotlinSplitterEndpointSpec<MethodInvokingSplitter>.() -> Unit): Unit

Populate the DefaultMessageSplitter with provided options to the current integration flow position.

fun split(): Unit

Populate the ExpressionEvaluatingSplitter with provided SpEL expression.

fun split(expression: String, endpointConfigurer: KotlinSplitterEndpointSpec<ExpressionEvaluatingSplitter>.() -> Unit = {}): Unit

Populate the MethodInvokingSplitter to evaluate the provided method of the service at runtime.

fun split(service: Any, methodName: String? = null): Unit

Populate the MethodInvokingSplitter to evaluate the provided method of the bean at runtime. In addition accept options for the integration endpoint using KotlinSplitterEndpointSpec.

fun split(service: Any, methodName: String?, splitterConfigurer: KotlinSplitterEndpointSpec<MethodInvokingSplitter>.() -> Unit): Unit
fun split(beanName: String, methodName: String?, splitterConfigurer: KotlinSplitterEndpointSpec<MethodInvokingSplitter>.() -> Unit): Unit

Populate the MethodInvokingSplitter to evaluate the provided method of the bean at runtime.

fun split(beanName: String, methodName: String? = null): Unit

Populate the MethodInvokingSplitter to evaluate the MessageProcessor at runtime from provided MessageProcessorSpec. In addition accept options for the integration endpoint using KotlinSplitterEndpointSpec.

fun split(messageProcessorSpec: MessageProcessorSpec<*>, splitterConfigurer: KotlinSplitterEndpointSpec<MethodInvokingSplitter>.() -> Unit = {}): Unit

Populate the provided AbstractMessageSplitter to the current integration flow position.

fun <S : AbstractMessageSplitter> split(splitterMessageHandlerSpec: MessageHandlerSpec<*, S>, splitterConfigurer: KotlinSplitterEndpointSpec<S>.() -> Unit = {}): Unit

Populate the provided AbstractMessageSplitter to the current integration flow position.

fun <S : AbstractMessageSplitter> split(splitter: S, splitterConfigurer: KotlinSplitterEndpointSpec<S>.() -> Unit = {}): Unit

transform

Inline function for IntegrationFlowDefinition.transform providing a transform<MyTypeIn, MyTypeOut>() variant with reified generic type.

fun <P> transform(function: (P) -> Any): Unit
fun <P> transform(function: (P) -> Any, configurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit): Unit

Populate the Transformer EI Pattern specific MessageHandler implementation for the provided Transformer instance.

fun transform(transformer: Transformer, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

Populate the Transformer EI Pattern specific MessageHandler implementation for the SpEL Expression.

fun transform(expression: String, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

Populate the MessageTransformingHandler for the MethodInvokingTransformer to invoke the service method at runtime.

fun transform(service: Any, methodName: String? = null): Unit
fun transform(service: Any, methodName: String?, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit): Unit

Populate the MessageTransformingHandler instance for the org.springframework.integration.handler.MessageProcessor from provided MessageProcessorSpec. In addition accept options for the integration endpoint using GenericEndpointSpec.

fun transform(messageProcessorSpec: MessageProcessorSpec<*>, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {}): Unit

trigger

Populate a ServiceActivatingHandler instance to perform MessageTriggerAction and endpoint options from GenericEndpointSpec.

fun trigger(triggerActionId: String, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit = {}): Unit
fun trigger(triggerAction: MessageTriggerAction, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit = {}): Unit

wireTap

Populate the Wire Tap EI Pattern specific org.springframework.messaging.support.ChannelInterceptor implementation to the current channel. This method can be used after any channel() for explicit MessageChannel, but with the caution do not impact existing org.springframework.messaging.support.ChannelInterceptors.

fun wireTap(flow: KotlinIntegrationFlowDefinition.() -> Unit): Unit
fun wireTap(wireTapConfigurer: WireTapSpec.() -> Unit, flow: KotlinIntegrationFlowDefinition.() -> Unit): Unit
fun wireTap(wireTapChannel: String, wireTapConfigurer: WireTapSpec.() -> Unit = {}): Unit
fun wireTap(wireTapChannel: MessageChannel, wireTapConfigurer: WireTapSpec.() -> Unit = {}): Unit
fun wireTap(wireTapSpec: WireTapSpec): Unit