Hi,
Can someone tell me what I am doing wrong.  I am using the File component
and I am trying to make the incoming files come in in order.  However, I
don't know how to specify the sorter.

context.addRoutes(new RouteBuilder() {
        public void configure() {
                JndiContext jcontext = null;
                try{
                        jcontext = new JndiContext();
                        jcontext.bind("DeadLetterChannelProcessor",
DeadLetterChannelProcessor.getInstance());
                        jcontext.bind("DPIFileSorter", new DPIFileSorter());
                } catch (Exception e){
                        logger.error("Unable to create camel context in 
MultiFormatDPI", e);
                }
        
                from("file://"+dir+"?delete=true&sorter=#DPIFileSorter").
                
errorHandler(deadLetterChannel("bean:DeadLetterChannelProcessor?method=handleError").maximumRedeliveries(1)).process(new
Processor() {
                        public void process(Exchange e) {
                                try {
                                        File file = 
(File)e.getIn().getBody(File.class);
                                        logger.info("Filename: " + 
file.toString());
                                        ...


It is in the context and I reference it with either DPIFileSorter or
#DPIFileSorter, but I still get:
Caused by: java.lang.IllegalArgumentException: Could not find a suitable
setter for property: sorter as there isn't a setter methd with same type:
java.lang.String nor type conversion possible: No type converter available
to convert from type: java.lang.Strig to the required type:
java.util.Comparator with value DPIFileSorter


Thanks for your help.
-- 
View this message in context: 
http://old.nabble.com/How-do-I-specify-sorting-in-file-component--tp28044191p28044191.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to