Announcement Announcement Module
Collapse
No announcement yet.
file inbound, detect multiple files Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • file inbound, detect multiple files

    Hi,

    i need a little bit input:

    I want to process multiple files from a directory at the same time. I don't know may be the aggregator pattern is right.

    So the use-case:
    In the inbound directory: FN.pdf, FN.txt, FN.ok. After the "FN.ok" file is detected, the inbound adapter should trigger and forward FN.pdf and FN.txt.

    How is the best practise solution? Create a customScanner?

    Can sombody help or hava an example?

    Thanks a lot!

  • #2
    Hi,

    You can use aggregator pattern. Take a look on the sample cafe application. There is a example how to overwrite correlation strategy.

    Code:
    @MessageEndpoint
    public class Waiter {
    
        @Aggregator(inputChannel = "preparedDrinks", outputChannel = "deliveries")
        public Delivery prepareDelivery(List<Drink> drinks) {
            return new Delivery(drinks);
        }
        
        @CorrelationStrategy
        public int correlateByOrderNumber(Drink drink) {
        	return drink.getOrderNumber();
        }
        
    }
    I forgot to mention that you have to be aware of the 'ReleaseStrategy' for aggregator. Check the documentation for more details - http://bit.ly/k7U7bc

    I hope it helps,
    Krzysiek
    Last edited by kgrodzicki; May 27th, 2011, 03:19 AM.

    Comment

    Working...
    X