0

I have below scenario using pollEnrich and Aggregator.

 private static final String SOURCE_FILE_COMPONENT = "file:%s?fileName=$simple{exchangeProperty.fileName}.%s";

  from("direct:signatureVerificationRoute")
         .pollEnrich(String.format(SOURCE_FILE_COMPONENT, sourceLocation,signatureAlgorithm), new Aggregator())
         .to("direct:test");

Where in above code, i have framed dynamic uri for pollEnrich which is not working.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
rocky
  • 753
  • 2
  • 10
  • 26

1 Answers1

1

You could use the overloaded pollEnrich which takes an Expression. Although you need to supply a timeout and the aggregation strategy as a bean ref, so it may not suit. If you supply null as the aggregation strategy ref it just uses the last messages, so the content of the file.

from("direct:signatureVerificationRoute")
        .pollEnrich(simple(String.format(SOURCE_FILE_COMPONENT, sourceLocation,signatureAlgorithm)), 2000, null, false)
        .to("direct:test");
pcoates
  • 2,102
  • 1
  • 9
  • 20