Hi,

The code that follows works and uses indirectly the HttpPollingConsumer
class, and I have two questions about it.
Where executed I get, at least, one page from Google web site.

Is there a way to poll with a choosen time interval?
When the Camel context is stopped, I see that the polling is not stopped. Is
it normal?


public class Test {

        public static void main(String[] args) throws Exception {
                                
                CamelContext camelContext = new DefaultCamelContext();
                
                final MockEndpoint mep = (MockEndpoint)
camelContext.getEndpoint("mock:test");          
                
                camelContext.addRoutes(new RouteBuilder() {
                    public void configure() {                   
                        from("http://www.google.com";).to(mep);          
                    }   
                });
                
                mep.expectedMinimumMessageCount(1);
                
                camelContext.start();
                
                Thread.sleep(5*1000);
                
                try {
                        mep.assertIsSatisfied();
                }
                finally {
                        camelContext.stop();
                }
        }

}

Thank you !

Bertrand ;-)
-- 
View this message in context: 
http://www.nabble.com/Questions-about-HttpPollingConsumer-tp16048601s22882p16048601.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to