Example usage for org.springframework.integration.dsl IntegrationFlows from

List of usage examples for org.springframework.integration.dsl IntegrationFlows from

Introduction

In this page you can find the example usage for org.springframework.integration.dsl IntegrationFlows from.

Prototype

public static IntegrationFlowBuilder from(Publisher<Message<?>> publisher) 

Source Link

Document

Populate a FluxMessageChannel to the IntegrationFlowBuilder chain and subscribe it to the provided Publisher .

Usage

From source file:org.springframework.cloud.stream.module.ftp.FtpSink.java

@Bean
public IntegrationFlow ftpInboundFlow() {
    FtpMessageHandlerSpec handlerSpec = Ftp
            .outboundAdapter(new FtpRemoteFileTemplate(this.ftpSessionFactory), this.properties.getMode())
            .remoteDirectory(this.properties.getRemoteDir())
            .remoteFileSeparator(this.properties.getRemoteFileSeparator())
            .autoCreateDirectory(this.properties.isAutoCreateDir())
            .temporaryFileSuffix(this.properties.getTmpFileSuffix());
    if (this.properties.getFilenameExpression() != null) {
        handlerSpec.fileNameExpression(this.properties.getFilenameExpression().getExpressionString());
    }/*from  ww w  .j a v a  2  s  .  c  o  m*/
    return IntegrationFlows.from(Sink.INPUT)
            .handle(handlerSpec, new Consumer<GenericEndpointSpec<FileTransferringMessageHandler<FTPFile>>>() {
                @Override
                public void accept(GenericEndpointSpec<FileTransferringMessageHandler<FTPFile>> e) {
                    e.autoStartup(false);
                }
            }).get();
}

From source file:org.springframework.integration.samples.mqtt.Application.java

@Bean
public IntegrationFlow mqttInFlow() {
    return IntegrationFlows.from(mqttInbound()).transform(p -> p + ", received from MQTT").handle(logger())
            .get();
}