camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wing-tung Leung <wingtung.le...@gmail.com>
Subject Re: Starting routes in StartupListener
Date Tue, 08 Nov 2011 14:43:06 GMT
On Tue, Nov 8, 2011 at 2:13 PM, wing-tung Leung <wingtung.leung@gmail.com>wrote:

> my camel context contains a few routes which should not be started
> automatically, but it should run a business check first for those routes.
> My initial idea is to disable "autoStartup" for those routes, and add a
> custom StartupListener which performs the check and simply calls
> "startRoute()" on the context if the check passes.
>

For your information, I found an easy workaround: I added an extra Spring
bean which implements the "ApplicationListener<ContextRefreshedEvent>"
interface, which fires up the relevant routes AFTER the complete
initialization of the Spring context.

Whether the StartupListener documentation/behavior is accurate, is another
discussion .. :-)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message