KotlinIntegrationFlowDefinition

An IntegrationFlowDefinition wrapped for Kotlin DSL.

Author

Artem Bilan

Since

5.3

Constructors

Link copied to clipboard
constructor(delegate: IntegrationFlowDefinition<*>)

Functions

Link copied to clipboard
fun aggregate(aggregator: Any)

A short-cut for the aggregate { processor(aggregatorProcessor) }

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

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

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

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

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

Populate a BridgeHandler to the current integration flow position.

Link copied to clipboard
fun channel(channels: Channels.() -> MessageChannelSpec<*, *>)

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

fun channel(messageChannelName: String)

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(messageChannelSpec: MessageChannelSpec<*, *>)

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

fun channel(messageChannel: MessageChannel)

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.

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

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

Link copied to clipboard
fun claimCheckOut(messageStore: MessageStore, removeMessage: Boolean = false)

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

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

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

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

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

Link copied to clipboard

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

Link copied to clipboard
inline fun <T> convert(crossinline configurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {})

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

Link copied to clipboard
fun delay(endpointConfigurer: DelayerEndpointSpec.() -> Unit)

Populate a DelayHandler to the current integration flow position. The DelayerEndpointSpec#messageGroupId(String) is required option.

Link copied to clipboard
fun enrich(enricherConfigurer: KotlinEnricherSpec.() -> Unit)

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

Link copied to clipboard
fun enrichHeaders(headerEnricherConfigurer: HeaderEnricherSpec.() -> Unit)
fun enrichHeaders(headers: Map<String, Any>, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> 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: MapBuilder<*, String, Any>, endpointConfigurer: GenericEndpointSpec<MessageTransformingHandler>.() -> Unit = {})

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.

Link copied to clipboard
inline fun <P> filter(crossinline function: (P) -> Boolean)
inline fun <P> filter(crossinline function: (P) -> Boolean, crossinline filterConfigurer: KotlinFilterEndpointSpec.() -> Unit)

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

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

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

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

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

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

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

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

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

Link copied to clipboard
fun fixedSubscriberChannel(messageChannelName: String? = null)

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

Link copied to clipboard
fun <I, O> fluxTransform(fluxFunction: (Flux<Message<I>>) -> Publisher<O>)

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.

Link copied to clipboard
fun gateway(endpointConfigurer: GatewayEndpointSpec.() -> Unit, flow: KotlinIntegrationFlowDefinition.() -> Unit)

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

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

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.

Link copied to clipboard
fun handle(messageHandler: (Message<*>) -> Unit)

Populate a ServiceActivatingHandler for the provided MessageHandler lambda.

inline fun <P> handle(crossinline handler: (P, MessageHeaders) -> Any)
fun <H : MessageHandler?> handle(messageHandlerSpec: MessageHandlerSpec<*, H>)

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

fun handle(messageHandler: MessageHandler)

Populate a ServiceActivatingHandler for the provided MessageHandler implementation.

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

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

fun handle(service: Any, methodName: String? = null)
fun handle(service: Any, methodName: String?, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit)
fun handle(beanName: String, methodName: String?, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> 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(messageHandler: (Message<*>) -> Unit, endpointConfigurer: GenericEndpointSpec<MessageHandler>.() -> Unit)

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

inline fun <P> handle(crossinline handler: (P, MessageHeaders) -> Any, crossinline endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> 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 handle(beanName: String, methodName: String? = null)

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

fun <H : MessageHandler> handle(messageHandlerSpec: MessageHandlerSpec<*, H>, endpointConfigurer: GenericEndpointSpec<H>.() -> 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 handle(messageProcessorSpec: MessageProcessorSpec<*>, endpointConfigurer: GenericEndpointSpec<ServiceActivatingHandler>.() -> Unit = {})

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

Link copied to clipboard
fun headerFilter(endpointConfigurer: HeaderFilterSpec.() -> Unit)

Provide the HeaderFilter to the current IntegrationFlow.

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

Populate the provided MessageTransformingHandler for the provided HeaderFilter.

Link copied to clipboard
fun intercept(vararg interceptorArray: ChannelInterceptor)

Add one or more ChannelInterceptor implementations to the current MessageChannel, in the given order, after any interceptors already registered.

Link copied to clipboard
fun 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 <P> log(function: (Message<P>) -> Any)

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 log(category: String)

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

fun log(logExpression: Expression)

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 <P> log(category: String, function: (Message<P>) -> Any)

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 log(category: String, logExpression: Expression)

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 <P> log(level: LoggingHandler.Level, function: (Message<P>) -> Any)

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 log(level: LoggingHandler.Level, category: String? = null)

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: LoggingHandler.Level, logExpression: Expression)

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 <P> log(level: LoggingHandler.Level, category: String, function: (Message<P>) -> Any)

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 log(level: LoggingHandler.Level, category: String, logExpression: String)
fun log(level: LoggingHandler.Level, category: String, logExpression: Expression)

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.

Link copied to clipboard
fun publishSubscribe(broadcastCapableChannel: BroadcastCapableChannel, vararg subscribeSubFlows: KotlinIntegrationFlowDefinition.() -> Unit)

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

Link copied to clipboard
fun resequence(resequencer: ResequencerSpec.() -> Unit = {})

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

Link copied to clipboard
inline fun <P> route(crossinline function: (P) -> Any?)
inline fun <P, T> route(crossinline function: (P) -> T, crossinline configurer: KotlinRouterSpec<T, MethodInvokingRouter>.() -> Unit)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Link copied to clipboard
Link copied to clipboard

Populate the RecipientListRouter with options from the KotlinRecipientListRouterSpec.

Link copied to clipboard

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, gatherer: AggregatorSpec.() -> Unit)
fun scatterGather(scatterer: KotlinRecipientListRouterSpec.() -> Unit, gatherer: AggregatorSpec.() -> Unit, scatterGather: ScatterGatherSpec.() -> 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(scatterChannel: MessageChannel, gatherer: AggregatorSpec.() -> Unit = {})
fun scatterGather(scatterChannel: MessageChannel, gatherer: AggregatorSpec.() -> Unit, scatterGather: ScatterGatherSpec.() -> Unit)

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

Link copied to clipboard
fun split()

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

inline fun <P> split(crossinline function: (P) -> Any)

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

fun split(expression: String)
fun split(splitterMessageHandlerSpec: MessageHandlerSpec<*, out AbstractMessageSplitter>)
fun split(messageProcessorSpec: MessageProcessorSpec<*>)

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

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

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

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

Link copied to clipboard
fun splitWith(splitterConfigurer: KotlinSplitterSpec.() -> Unit)

Populate a splitter endpoint.

Link copied to clipboard
inline fun <P> transform(crossinline function: (P) -> Any)

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

fun transform(expression: String)

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

fun transform(messageProcessorSpec: MessageProcessorSpec<*>)
fun transform(transformer: Transformer)

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

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

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

Link copied to clipboard
fun transformWith(transformerConfigurer: KotlinTransformerEndpointSpec.() -> Unit)

Populate a transformer endpoint.

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

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

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

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.