org.ow2.jonas.camel.component
Class HttpClientProcessor
java.lang.Object
org.ow2.jonas.camel.component.HttpClientProcessor
- All Implemented Interfaces:
- org.apache.camel.Processor
public class HttpClientProcessor
- extends java.lang.Object
- implements org.apache.camel.Processor
HTTP client processor, which can replace the CAMEL http processor. We need
this processor as camel-http has some weird dependencies, most
notably and old version of HTTPClient, which doesn't behave well
with OSGi environments.
It does simple HTTP GET requests and adds all CAMEL headers to the GET
request's arguments.
It is used exactly as any other processor:
// Example: search on Google the file name of the incoming file
this.from("file:///camel/test-google-requests")
// Google uses the HTTP GET variable q for the search query
.setHeader("q", this.header(Exchange.FILE_NAME))
.process(new HttpClientProcessor("http://www.google.com/"))
// Write response to an HTML file
.to("file:///camel/test-google-responses/?fileName=${file:name}.html");
|
Method Summary |
void |
process(org.apache.camel.Exchange exchange)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpClientProcessor
public HttpClientProcessor(java.lang.String httpUrl)
process
public void process(org.apache.camel.Exchange exchange)
throws java.lang.Exception
- Specified by:
process in interface org.apache.camel.Processor
- Throws:
java.lang.Exception
Copyright © 2010 OW2 Consortium. All Rights Reserved.
Apache Camel version 2.5.0, OW2 JOnAS version 5.2.0-M3