Class IntegrationFlowAdapter
java.lang.Object
org.springframework.integration.dsl.IntegrationFlowAdapter
- All Implemented Interfaces:
org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,IntegrationFlow
,ManageableLifecycle
,ManageableSmartLifecycle
public abstract class IntegrationFlowAdapter extends java.lang.Object implements IntegrationFlow, ManageableSmartLifecycle
The base
Adapter
class for the IntegrationFlow
abstraction.
Requires the implementation for the buildFlow()
method to produce
IntegrationFlowDefinition
using one of from(java.lang.String)
support methods.
Typically is used for target service implementation:
@Component public class MyFlowAdapter extends IntegrationFlowAdapter { @Autowired private ConnectionFactory rabbitConnectionFactory; @Override protected IntegrationFlowDefinition<?> buildFlow() { return from(Amqp.inboundAdapter(this.rabbitConnectionFactory, "myQueue")) .<String, String>transform(String::toLowerCase) .channel(c -> c.queue("myFlowAdapterOutput")); } }
- Since:
- 5.0
-
Field Summary
-
Constructor Summary
Constructors Constructor Description IntegrationFlowAdapter()
-
Method Summary
Modifier and Type Method Description protected abstract IntegrationFlowDefinition<?>
buildFlow()
void
configure(IntegrationFlowDefinition<?> flow)
The callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition
.protected IntegrationFlowBuilder
from(java.lang.Class<?> serviceInterface)
protected IntegrationFlowBuilder
from(java.lang.Class<?> serviceInterface, java.util.function.Consumer<GatewayProxySpec> endpointConfigurer)
Start a flow from a proxy for the service interface.protected IntegrationFlowDefinition<?>
from(java.lang.String messageChannelName)
protected IntegrationFlowDefinition<?>
from(java.lang.String messageChannelName, boolean fixedSubscriber)
protected IntegrationFlowBuilder
from(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> publisher)
protected IntegrationFlowDefinition<?>
from(MessageSource<?> messageSource)
protected IntegrationFlowDefinition<?>
from(MessageSource<?> messageSource, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
protected IntegrationFlowDefinition<?>
from(MessageChannelSpec<?,?> messageChannelSpec)
protected IntegrationFlowDefinition<?>
from(MessageProducerSpec<?,?> messageProducerSpec)
protected IntegrationFlowDefinition<?>
from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec)
protected IntegrationFlowDefinition<?>
from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
protected IntegrationFlowDefinition<?>
from(MessagingGatewaySpec<?,?> inboundGatewaySpec)
protected IntegrationFlowDefinition<?>
from(MessageProducerSupport messageProducer)
protected IntegrationFlowDefinition<?>
from(MessagingGatewaySupport inboundGateway)
protected IntegrationFlowDefinition<?>
from(org.springframework.messaging.MessageChannel messageChannel)
protected <T> IntegrationFlowBuilder
fromSupplier(java.util.function.Supplier<T> messageSource)
protected <T> IntegrationFlowBuilder
fromSupplier(java.util.function.Supplier<T> messageSource, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer)
org.springframework.messaging.MessageChannel
getInputChannel()
Return the firstMessageChannel
component which is essentially a flow input channel.java.util.Map<java.lang.Object,java.lang.String>
getIntegrationComponents()
Return a map of integration components managed by this flow (if any).int
getPhase()
boolean
isAutoStartup()
boolean
isRunning()
void
start()
void
stop()
void
stop(java.lang.Runnable callback)
-
Constructor Details
-
IntegrationFlowAdapter
public IntegrationFlowAdapter()
-
-
Method Details
-
configure
Description copied from interface:IntegrationFlow
The callback-based function to declare the chain of EIP-methods to configure an integration flow with the providedIntegrationFlowDefinition
.- Specified by:
configure
in interfaceIntegrationFlow
- Parameters:
flow
- theIntegrationFlowDefinition
to configure
-
getInputChannel
public org.springframework.messaging.MessageChannel getInputChannel()Description copied from interface:IntegrationFlow
Return the firstMessageChannel
component which is essentially a flow input channel.- Specified by:
getInputChannel
in interfaceIntegrationFlow
- Returns:
- the channel.
-
getIntegrationComponents
public java.util.Map<java.lang.Object,java.lang.String> getIntegrationComponents()Description copied from interface:IntegrationFlow
Return a map of integration components managed by this flow (if any).- Specified by:
getIntegrationComponents
in interfaceIntegrationFlow
- Returns:
- the map of integration components managed by this flow.
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
- Specified by:
start
in interfaceManageableLifecycle
-
stop
public void stop(java.lang.Runnable callback)- Specified by:
stop
in interfaceorg.springframework.context.SmartLifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
- Specified by:
stop
in interfaceManageableLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
- Specified by:
isRunning
in interfaceManageableLifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartup
in interfaceorg.springframework.context.SmartLifecycle
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in interfaceorg.springframework.context.SmartLifecycle
-
from
-
from
protected IntegrationFlowDefinition<?> from(org.springframework.messaging.MessageChannel messageChannel) -
from
protected IntegrationFlowDefinition<?> from(java.lang.String messageChannelName, boolean fixedSubscriber) -
from
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
protected IntegrationFlowDefinition<?> from(MessageSource<?> messageSource, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
-
from
-
from
-
from
-
from
-
from
protected IntegrationFlowDefinition<?> from(MessageSourceSpec<?,? extends MessageSource<?>> messageSourceSpec) -
from
-
fromSupplier
-
fromSupplier
protected <T> IntegrationFlowBuilder fromSupplier(java.util.function.Supplier<T> messageSource, java.util.function.Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) -
from
-
from
protected IntegrationFlowBuilder from(java.lang.Class<?> serviceInterface, @Nullable java.util.function.Consumer<GatewayProxySpec> endpointConfigurer)Start a flow from a proxy for the service interface.- Parameters:
serviceInterface
- the service interface class.endpointConfigurer
- theConsumer
to configure proxy bean for gateway.- Returns:
- new
IntegrationFlowBuilder
. - Since:
- 5.2
-
from
protected IntegrationFlowBuilder from(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> publisher) -
buildFlow
-