2 Replies Latest reply on Feb 8, 2011 9:14 PM by Willem Jiang

    Jetty:http endpoint issue

    Matt Felstead Newbie

      Evening

       

      I'm having issues consuming from a Jetty:http endpoint, I've attempted to use the camel-jetty component to create a simple route as follows:

       

      context.addRoutes(new RouteBuilder() {

       

                  public void configure() {

                from("jetty:http://localhost:8080").process(new Processor() {

                              public void process(Exchange e) {

                              System.out.println("HTTP REQUEST Received" );

                          }

                      });

                  }

              });

       

      I've launched a server, using the jetty-server from eclipse.org, as follows:

       

      Server server = new Server(8080);

      server.start();

       

      When running the above and entering "http://localhost:8080" into a browser I expected to see "HTTP REQUEST Received". Unfortunately I didn't.

       

      I commented out the above route and added a handler to the server which displayed a simple webpage when "http://localhost:8080" is entered into a browser. When uncommenting the above route the webpage stopped working.

       

      Any ideas what I'm doing wrong here?

       

      Many thanks for your help in advance.

       

      Matt