Ok, according to documentation on the bottom of this page:
http://camel.apache.org/using-camelproxy.html

I did the following:

public interface AsyncHandler {
    Future<EventData> asyncHandle(EventData data) throws HandlerException;
}

public interface SyncHandler {
    EventData handle(EventData data) throws HandlerException;
}

public interface Handler extends SyncHandler, AsyncHandler {
}

Then, I implemented asyncHandle in my base abstract class as:

    @Override
    public Future<EventData> asyncHandle(final EventData data) throws
HandlerException {
        return
            new FutureTask<>(
                new Callable<EventData>() {
                    @Override
                    public EventData call() throws Exception {
                        return
                            handle(data);
                    }
                }
            );
    }

Finally, I changed all my proxy references to use AsyncHandler as the
interface and I changed all my invocations to use asyncHandle which returns
Future<EventData>.

However, I must still be missing something as my processing does not advance
past the from, and still returns with: The OUT message was not received
within: 30000 millis.

I feel that somehow I need to tie this together with a ThreadPool and
execute my FutureTask<EventData>, but I thought that Camel would do that...

Do I need to create my own ThreadPool, throw the FutureTask<EventData> in
there and at the same time return it to the caller?

How do I get a reference to a thread pool created by Camel without tying my
code to Camel and making it aware of Camel?  Am I still missing something in
the configuration?  I changed all my routes to be vm:// instead of
direct://.

Lord have mercy.

-AP_






--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-setup-route-with-limit-of-30-queue-size-and-5-processing-threads-tp5766520p5766537.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to