Spring Integration FTP in Docker container: not triggering flow

I am having quite a time figuring out where my issue is stemming from. I can run locally, I have built my .jar and ran that locally too.

I have my integration flow set as follows

@Bean
IntegrationFlow integrationFlow(final DataSource datasource) {
return IntegrationFlows.from(
    Ftp.inboundStreamingAdapter(template())
        .remoteDirectory("/folder/")
        .patternFilter("file_name.txt")
        .filter(
            new FtpPersistentAcceptOnceFileListFilter(metadataStore(datasource), "")),
    spec -> spec.poller(Pollers.fixedDelay(5, TimeUnit.SECONDS)))
    .transform(streamToBytes())
    .get()
}

@Bean
FtpRemoteFileTemplate template() {
  return new FtpRemoteFileTemplate(ftpSessionFactory());
}

@Bean
public StreamTransformer streamToBytes() {
  return new StreamTransformer(); // transforms to byte[]
}

@Bean
public ConcurrentMetadataStore metadataStore(final DataSource dataSource) {
  return new JdbcMetadataStore(dataSource);
}

@Bean
public SessionFactory<FTPFile> ftpSessionFactory() {
  DefaultFtpSessionFactory sf = new DefaultFtpSessionFactory();
  sf.setHost(host);
  sf.setPort(port);
  sf.setUsername(userName);
  sf.setPassword(password);
  return sf;
}

I have my datasource and my ftp information set in my application.yml

When I run this locally, I have no problems. When I run gradle build and run my .jar with several different openjdk versions (8u181, 8u191, 11.04), I have no issues.

When I run inside of a docker container using my .jar file, the problem arises.

My docker file

FROM openjdk:8u212-jdk-alpine
WORKDIR /app

COPY build/libs/app-1.0.jar .

RUN apk add --update ttf-dejavu && rm -rf /var/cache/apk/*

ENTRYPOINT ["java", "-jar", "app-1.0.jar"]

I turned DEBUG on and watched output.

Running locally and running the built .jar, I can see that the poller is working and it triggers the SQL queries to the metadataStore table that has been created in my remote db (postgresql).

Running in the docker container, I do not see the sql queries being run. which tells me that somewhere therein lies the issue.

With debug on my startup logs in the console are the same INFOs and WARNs regardless of running locally, running the built .jar, or running in the docker container.

I checked to see if there might be a hidden SessionFactory connection issue by trying to connect to an invalid host, but I indeed get exceptions in my docker container for the invalid host. So I can confidently say that the FTP connection is valid and running with the correct host and port.

I am thinking it has to do with either the poller or my datasource.

Inside of this application, I am also running Spring Data Rest using JDBC and JPA, would there be any issue with the usage of the datasource bean across the different libraries?

Any help or guidance would be greatly appreciated.

Source: StackOverflow