camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mon Baroi <baroi...@gmail.com>
Subject Camel Web Service + Jetty Component
Date Fri, 03 Apr 2015 13:45:58 GMT
Hey Guys,

I'm a newbie to Camel and self-taught in Java. I've been scouring the
internet and I hope you can point me in the right direction.

This is what I am trying to do:

(1) User hits a web service

(2) As a response the web service returns a webpage

I know I have to use HTTP and that the Jetty component is my best bet.

This is my Route class:

*public class MyRoute extends RouteBuilder {*

*@Override*

*public void configure() throws Exception {*

*           from("jetty://http://localhost:8080/ExchangeSendPage
<http://localhost:8080/ExchangeSendPage>")*

*           //.setHeader("webPageFileName", constant("index.html"))*

*           .process(new myProcessor()); *

*           .to()*

*    }*

*}); *

*}*

This my Processor Class:

*public class myProcessor implements Processor {*

*public void theprocess (Exchange exchange) throw Exception {*

*    return ("ExchangeSendPage.html"); *

*}*

I am completely lost and could use some guidance on the following:

 (1) How do I set up my localhost where when the user is on their own
machine, they can just click on the .html file? Would I use xpath? Right
now I don't have the .html file going anywhere. I'm sure its not even
attached to the local host.

(2) How do I attach my html page to my processor? Or is this even the right
way to go about doing it?

(3) Should the .to go to the URL of the server that it would be hitting?
This would be considered an endpoint?

Please let me know if anything is confusing.


Thank you so much,

Mon.

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