public PollerSpec fixedDelay(long period) { return Pollers.fixedDelay(period); }
public PollerSpec fixedDelay(long period, long initialDelay) { return Pollers.fixedDelay(period, initialDelay); }
public PollerSpec fixedDelay(long period) { return Pollers.fixedDelay(period); }
public PollerSpec fixedDelay(long period, long initialDelay) { return Pollers.fixedDelay(period, initialDelay); }
public static PollerSpec fixedDelay(long period, TimeUnit timeUnit) { return fixedDelay(period, timeUnit, 0); }
public PollerSpec fixedDelay(long period, TimeUnit timeUnit) { return Pollers.fixedDelay(period, timeUnit); }
public static PollerSpec fixedDelay(long period) { return fixedDelay(period, null); }
public static PollerSpec fixedDelay(long period) { return fixedDelay(period, null); }
public PollerSpec fixedDelay(long period, TimeUnit timeUnit, long initialDelay) { return Pollers.fixedDelay(period, timeUnit, initialDelay); }
public PollerSpec fixedDelay(long period, TimeUnit timeUnit, long initialDelay) { return Pollers.fixedDelay(period, timeUnit, initialDelay); }
public PollerSpec fixedDelay(long period, TimeUnit timeUnit) { return Pollers.fixedDelay(period, timeUnit); }
public static PollerSpec fixedDelay(long period, TimeUnit timeUnit) { return fixedDelay(period, timeUnit, 0); }
@Bean @Autowired public IntegrationFlow processProduct(MongoDbFactory mongo) { return IntegrationFlows.from(mongoMessageSource(mongo), c -> c.poller(Pollers.fixedDelay(3, TimeUnit.SECONDS))) .route(Product::isPremium, this::routeProducts) .handle(mongoOutboundAdapter(mongo)) .get(); }
@Bean public IntegrationFlow priorityFlow(PriorityCapableChannelMessageStore mongoDbChannelMessageStore) { return IntegrationFlows.from((Channels c) -> c.priority("priorityChannel", mongoDbChannelMessageStore, "priorityGroup")) .bridge(s -> s.poller(Pollers.fixedDelay(100)) .autoStartup(false) .id("priorityChannelBridge")) .channel(MessageChannels.queue("priorityReplyChannel")) .get(); }
@Bean public IntegrationFlow fileToFile() { return IntegrationFlows.from(Files.inboundAdapter(new File("/tmp/in")) .autoCreateDirectory(true) .patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000))) .transform(Transformers.fileToString()) .transform("payload.replaceAll('\r\n', '\n')") .handle(Files.outboundAdapter("'/tmp/out'") .autoCreateDirectory(true)) .get(); }
@Bean public IntegrationFlow fileToFile() { return IntegrationFlows.from(Files.inboundAdapter(new File("/tmp/in")) .autoCreateDirectory(true) .patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000))) .transform(Transformers.fileToString()) .transform("payload.replaceAll('\r\n', '\n')") .publishSubscribeChannel(c -> c .subscribe(s -> s.handle(Files.outboundAdapter("'/tmp/out'") .autoCreateDirectory(true))) .subscribe(s -> s.log(LoggingHandler.Level.WARN, null, "headers['file_originalFile'].absolutePath + ' transferred'"))) .get(); }
@Bean public IntegrationFlow fileReadingFlow() { return IntegrationFlows .from(s -> s.file(tmpDir.getRoot()) .patternFilter("*.sitest") .useWatchService(true) .watchEvents(FileReadingMessageSource.WatchEventType.CREATE, FileReadingMessageSource.WatchEventType.MODIFY), e -> e.poller(Pollers.fixedDelay(100) .errorChannel("filePollingErrorChannel"))) .filter(File.class, p -> !p.getName().startsWith("a"), e -> e.throwExceptionOnRejection(true)) .transform(Transformers.fileToString()) .aggregate(a -> a.correlationExpression("1") .releaseStrategy(g -> g.size() == 25)) .channel(MessageChannels.queue("fileReadingResultChannel")) .get(); }
@Bean public IntegrationFlow fileSplitterAggregator() { return IntegrationFlows .from(Files.inboundAdapter(new File("/tmp/in")) .autoCreateDirectory(true) .patternFilter("*.txt"), e -> e.poller(Pollers.fixedDelay(5000))) .split(Files.splitter() .markers() .applySequence(true)) .filter(p -> !(p instanceof FileSplitter.FileMarker), e -> e.discardChannel("aggregatorChannel")) .<String, Name>transform(Name::new) .<Name>filter(p -> !p.getValue().startsWith("X")) .channel("aggregatorChannel") .aggregate(a -> a.processor(new FileMarkerAggregator())) .<List<Name>, Names>transform(Names::new) .transform(Transformers.marshaller(jaxbMarshaller(), new ResultToStringTransformer())) .handle(Files.outboundAdapter("'/tmp/out'") .fileNameGenerator(m -> m .getHeaders() .get(FileHeaders.FILENAME, String.class) .replace(".txt", ".xml")) .autoCreateDirectory(true)) .get(); }