Class IntegrationFlows
java.lang.Object
org.springframework.integration.dsl.IntegrationFlows
public final class IntegrationFlows extends Object
The central factory for fluent
IntegrationFlowBuilder
API.- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell, Oleg Zhurakousky
- See Also:
IntegrationFlowBeanPostProcessor
-
Method Summary
Modifier and Type Method Description static IntegrationFlowBuilder
from(Class<?> serviceInterface)
Populate theMessageChannel
to the newIntegrationFlowBuilder
chain, which becomes as arequestChannel
for the Messaging Gateway(s) built on the provided service interface.static IntegrationFlowBuilder
from(Class<?> serviceInterface, Consumer<GatewayProxySpec> endpointConfigurer)
Populate theMessageChannel
to the newIntegrationFlowBuilder
chain, which becomes as arequestChannel
for the Messaging Gateway(s) built on the provided service interface.static IntegrationFlowBuilder
from(String messageChannelName)
Populate theMessageChannel
name to the newIntegrationFlowBuilder
chain.static IntegrationFlowBuilder
from(String messageChannelName, boolean fixedSubscriber)
Populate theMessageChannel
name to the newIntegrationFlowBuilder
chain.static IntegrationFlowBuilder
from(org.reactivestreams.Publisher<? extends Message<?>> publisher)
Populate aFluxMessageChannel
to theIntegrationFlowBuilder
chain and subscribe it to the providedPublisher
.static IntegrationFlowBuilder
from(MessageSource<?> messageSource)
Populate the providedMessageSource
object to theIntegrationFlowBuilder
chain.static IntegrationFlowBuilder
from(MessageSource<?> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
Populate the providedMessageSource
object to theIntegrationFlowBuilder
chain.static IntegrationFlowBuilder
from(MessageChannelSpec<?,?> messageChannelSpec)
Populate theMessageChannel
object to theIntegrationFlowBuilder
chain using the fluent API fromMessageChannelSpec
.static IntegrationFlowBuilder
from(MessageProducerSpec<?,?> messageProducerSpec)
Populate theMessageProducerSupport
object to theIntegrationFlowBuilder
chain using the fluent API from theMessageProducerSpec
.static IntegrationFlowBuilder
from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec)
Populate theMessageSource
object to theIntegrationFlowBuilder
chain using the fluent API from the providedMessageSourceSpec
.static IntegrationFlowBuilder
from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
Populate theMessageSource
object to theIntegrationFlowBuilder
chain using the fluent API from the providedMessageSourceSpec
.static IntegrationFlowBuilder
from(MessagingGatewaySpec<?,?> inboundGatewaySpec)
Populate theMessagingGatewaySupport
object to theIntegrationFlowBuilder
chain using the fluent API from theMessagingGatewaySpec
.static IntegrationFlowBuilder
from(MessageProducerSupport messageProducer)
Populate the providedMessageProducerSupport
object to theIntegrationFlowBuilder
chain.static IntegrationFlowBuilder
from(MessagingGatewaySupport inboundGateway)
Populate the providedMessagingGatewaySupport
object to theIntegrationFlowBuilder
chain.static IntegrationFlowBuilder
from(MessageChannel messageChannel)
Populate the providedMessageChannel
object to theIntegrationFlowBuilder
chain.static <T> IntegrationFlowBuilder
fromSupplier(Supplier<T> messageSource)
ProvidesSupplier
as source of messages to the integration flow which will be triggered by the application context's default poller (which must be declared).static <T> IntegrationFlowBuilder
fromSupplier(Supplier<T> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
ProvidesSupplier
as source of messages to the integration flow.
-
Method Details
-
from
Populate theMessageChannel
name to the newIntegrationFlowBuilder
chain. TheIntegrationFlow
inputChannel
.- Parameters:
messageChannelName
- the name of existingMessageChannel
bean. The newDirectChannel
bean will be created on context startup if there is no bean with this name.- Returns:
- new
IntegrationFlowBuilder
.
-
from
Populate theMessageChannel
name to the newIntegrationFlowBuilder
chain. Typically for theFixedSubscriberChannel
together withfixedSubscriber = true
. TheIntegrationFlow
inputChannel
.- Parameters:
messageChannelName
- the name forDirectChannel
orFixedSubscriberChannel
to be created on context startup, not reference. TheMessageChannel
depends on thefixedSubscriber
boolean argument.fixedSubscriber
- the boolean flag to determine if resultMessageChannel
should beDirectChannel
, iffalse
orFixedSubscriberChannel
, iftrue
.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
DirectChannel
,FixedSubscriberChannel
-
from
Populate theMessageChannel
object to theIntegrationFlowBuilder
chain using the fluent API fromMessageChannelSpec
. TheIntegrationFlow
inputChannel
.- Parameters:
messageChannelSpec
- the MessageChannelSpec to populateMessageChannel
instance.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
MessageChannels
-
from
Populate the providedMessageChannel
object to theIntegrationFlowBuilder
chain. TheIntegrationFlow
inputChannel
.- Parameters:
messageChannel
- theMessageChannel
to populate.- Returns:
- new
IntegrationFlowBuilder
.
-
from
public static IntegrationFlowBuilder from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec)Populate theMessageSource
object to theIntegrationFlowBuilder
chain using the fluent API from the providedMessageSourceSpec
. TheIntegrationFlow
startMessageSource
.- Parameters:
messageSourceSpec
- theMessageSourceSpec
to use.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
and its implementations.
-
from
public static IntegrationFlowBuilder from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)Populate theMessageSource
object to theIntegrationFlowBuilder
chain using the fluent API from the providedMessageSourceSpec
. TheIntegrationFlow
startMessageSource
.- Parameters:
messageSourceSpec
- theMessageSourceSpec
to use.endpointConfigurer
- theConsumer
to provide more options for theSourcePollingChannelAdapterFactoryBean
.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
MessageSourceSpec
,SourcePollingChannelAdapterSpec
-
fromSupplier
ProvidesSupplier
as source of messages to the integration flow which will be triggered by the application context's default poller (which must be declared).- Type Parameters:
T
- the supplier type.- Parameters:
messageSource
- theSupplier
to populate.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
Supplier
-
fromSupplier
public static <T> IntegrationFlowBuilder fromSupplier(Supplier<T> messageSource, Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)ProvidesSupplier
as source of messages to the integration flow. which will be triggered by a providedSourcePollingChannelAdapter
.- Type Parameters:
T
- the supplier type.- Parameters:
messageSource
- theSupplier
to populate.endpointConfigurer
- theConsumer
to provide more options for theSourcePollingChannelAdapterFactoryBean
.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
Supplier
-
from
Populate the providedMessageSource
object to theIntegrationFlowBuilder
chain. TheIntegrationFlow
startMessageSource
.- Parameters:
messageSource
- theMessageSource
to populate.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
MessageSource
-
from
public static IntegrationFlowBuilder from(MessageSource<?> messageSource, @Nullable Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)Populate the providedMessageSource
object to theIntegrationFlowBuilder
chain. TheIntegrationFlow
startMessageSource
. In addition useSourcePollingChannelAdapterSpec
to provide options for the underlyingSourcePollingChannelAdapter
endpoint.- Parameters:
messageSource
- theMessageSource
to populate.endpointConfigurer
- theConsumer
to provide more options for theSourcePollingChannelAdapterFactoryBean
.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
MessageSource
,SourcePollingChannelAdapterSpec
-
from
Populate theMessageProducerSupport
object to theIntegrationFlowBuilder
chain using the fluent API from theMessageProducerSpec
. TheIntegrationFlow
startMessageProducer
.- Parameters:
messageProducerSpec
- theMessageProducerSpec
to use.- Returns:
- new
IntegrationFlowBuilder
. - See Also:
MessageProducerSpec
-
from
Populate the providedMessageProducerSupport
object to theIntegrationFlowBuilder
chain. TheIntegrationFlow
startMessageProducer
.- Parameters:
messageProducer
- theMessageProducerSupport
to populate.- Returns:
- new
IntegrationFlowBuilder
.
-
from
Populate theMessagingGatewaySupport
object to theIntegrationFlowBuilder
chain using the fluent API from theMessagingGatewaySpec
. TheIntegrationFlow
startMessagingGateway
.- Parameters:
inboundGatewaySpec
- theMessagingGatewaySpec
to use.- Returns:
- new
IntegrationFlowBuilder
.
-
from
Populate the providedMessagingGatewaySupport
object to theIntegrationFlowBuilder
chain. TheIntegrationFlow
startMessageProducer
.- Parameters:
inboundGateway
- theMessagingGatewaySupport
to populate.- Returns:
- new
IntegrationFlowBuilder
.
-
from
Populate theMessageChannel
to the newIntegrationFlowBuilder
chain, which becomes as arequestChannel
for the Messaging Gateway(s) built on the provided service interface.A gateway proxy bean for provided service interface is registered under a name from the
MessagingGateway.name()
if present or from theIntegrationFlow
bean name plus.gateway
suffix.- Parameters:
serviceInterface
- the service interface class with an optionalMessagingGateway
annotation.- Returns:
- new
IntegrationFlowBuilder
.
-
from
public static IntegrationFlowBuilder from(Class<?> serviceInterface, @Nullable Consumer<GatewayProxySpec> endpointConfigurer)Populate theMessageChannel
to the newIntegrationFlowBuilder
chain, which becomes as arequestChannel
for the Messaging Gateway(s) built on the provided service interface.A gateway proxy bean for provided service interface is based on the options configured via provided
Consumer
.- Parameters:
serviceInterface
- the service interface class with an optionalMessagingGateway
annotation.endpointConfigurer
- theConsumer
to configure proxy bean for gateway.- Returns:
- new
IntegrationFlowBuilder
. - Since:
- 5.2
-
from
public static IntegrationFlowBuilder from(org.reactivestreams.Publisher<? extends Message<?>> publisher)Populate aFluxMessageChannel
to theIntegrationFlowBuilder
chain and subscribe it to the providedPublisher
.- Parameters:
publisher
- thePublisher
to subscribe to.- Returns:
- new
IntegrationFlowBuilder
.
-