You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by buchnerm <ma...@gmx.at> on 2008/07/17 13:16:23 UTC
How to define a HTTP Post destination in a route in spring
this is the example on the camel site how to create a HTTP component:
new RouteBuilder() {
public void configure() {
from("direct:start")
.setHeader(org.apache.camel.component.http.HttpMethods.HTTP_METHOD,
org.apache.camel.component.http.HttpMethods.POST)
.to("http://www.google.com");
}
};
How to do the same in spring???
<route>
<from uri="direct:in" />
<to uri="http:localhost:8080/test.jsp" />
</route>
How to tell him to send it via post??
Thanks Max
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18506233.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to define a HTTP Post destination in a route in spring
Posted by buchnerm <ma...@gmx.at>.
Hi its me again
my code now is:
<route>
<from uri="direct:in" />
<!-- write to a file
<to uri="file:c:\\tmp\\recMessage.txt?autoCreate=false" />
-->
<!-- write to http -->
<setHeader headerName="http.requestMethod" >
<simple>POST</simple>
</setHeader>
<to uri="http:http://localhost:8888/test.jsp" />
</route>
now it throws the following error:
2008-07-17 17:39:24,203 ERROR [DefaultMessageListenerContainer-1036]
org.apache.camel.processor.DeadLetterChannel: Failed delivery for
exchangeId: ID-power/2149-1216309145187/0-7771. On delivery attempt: 0
caught: java.lang.IllegalArgumentException: Host name may not be null
java.lang.IllegalArgumentException: Host name may not be null
at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:68)
at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107)
at
org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
at
org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:220)
at
org.apache.commons.httpclient.methods.ExpectContinueMethod.<init>(ExpectContinueMethod.java:93)
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.<init>(EntityEnclosingMethod.java:119)
at
org.apache.commons.httpclient.methods.PostMethod.<init>(PostMethod.java:106)
at
org.apache.camel.component.http.HttpProducer.createMethod(HttpProducer.java:97)
at
org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:48)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:73)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:45)
at org.apache.camel.util.ProducerCache.sendExchange(ProducerCache.java:147)
at org.apache.camel.util.ProducerCache.send(ProducerCache.java:84)
at org.apache.camel.CamelTemplate.send(CamelTemplate.java:119)
at org.apache.camel.CamelTemplate.sendBody(CamelTemplate.java:170)
at org.apache.camel.CamelTemplate.sendBody(CamelTemplate.java:183)
at
com.fatwire.analytics.service.InterceptorService.process(InterceptorService.java:69)
at
com.fatwire.analytics.service.InterceptorService.process(InterceptorService.java:1)
at
com.fatwire.analytics.camel.processor.ServiceProcessor.process(ServiceProcessor.java:20)
at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:72)
at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:50)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:73)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:66)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:316)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:887)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
at java.lang.Thread.run(Thread.java:595)
Any solution for that??
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18511514.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: How to define a HTTP Post destination in a route in spring
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi
Ah looks like the header expects a sub element. You can either use this trick ( a bit ugly)
<setHeader headerName="theHeader" value="a value">
<expression/>
</setHeader>
Or use this one
<setHeader headerName="oldBodyValue">
<simple>POST</simple>
</setHeader>
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: buchnerm [mailto:markus.buchner@gmx.at]
Sent: 17. juli 2008 16:26
To: camel-user@activemq.apache.org
Subject: Re: How to define a HTTP Post destination in a route in spring
Thanks for the help but I still have issues:
my code now:
<route>
<from uri="direct:in" />
<!-- write to a file
<to uri="file:c:\\tmp\\recMessage.txt?autoCreate=false" />
-->
<!-- write to http -->
<setHeader headerName="http.requestMethod" value="POST" />
<to uri="http:localhost:8888/test.jsp" />
</route>
with this xsd:
http://activemq.apache.org/camel/schema/spring/camel-spring-1.4-SNAPSHOT.xsd
Then I get this failure:
cvc-complex-type.2.4.b: The content of element 'setHeader' is not complete.
One of '{"http://
activemq.apache.org/camel/schema/spring":description,
"http://activemq.apache.org/camel/
schema/spring":el, "http://activemq.apache.org/camel/schema/spring":groovy,
"http://
activemq.apache.org/camel/schema/spring":header,
"http://activemq.apache.org/camel/schema/
spring":jxpath,
"http://activemq.apache.org/camel/schema/spring":javaScript, "http://
activemq.apache.org/camel/schema/spring":expression,
"http://activemq.apache.org/camel/
schema/spring":methodCall,
"http://activemq.apache.org/camel/schema/spring":ognl, "http://
activemq.apache.org/camel/schema/spring":php,
"http://activemq.apache.org/camel/schema/
spring":python, "http://activemq.apache.org/camel/schema/spring":ruby,
"http://
activemq.apache.org/camel/schema/spring":simple,
"http://activemq.apache.org/camel/schema/
spring":sql, "http://activemq.apache.org/camel/schema/spring":xpath,
"http://
activemq.apache.org/camel/schema/spring":xquery}' is expected.
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18509696.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to define a HTTP Post destination in a route in spring
Posted by buchnerm <ma...@gmx.at>.
Thanks for the help but I still have issues:
my code now:
<route>
<from uri="direct:in" />
<!-- write to a file
<to uri="file:c:\\tmp\\recMessage.txt?autoCreate=false" />
-->
<!-- write to http -->
<setHeader headerName="http.requestMethod" value="POST" />
<to uri="http:localhost:8888/test.jsp" />
</route>
with this xsd:
http://activemq.apache.org/camel/schema/spring/camel-spring-1.4-SNAPSHOT.xsd
Then I get this failure:
cvc-complex-type.2.4.b: The content of element 'setHeader' is not complete.
One of '{"http://
activemq.apache.org/camel/schema/spring":description,
"http://activemq.apache.org/camel/
schema/spring":el, "http://activemq.apache.org/camel/schema/spring":groovy,
"http://
activemq.apache.org/camel/schema/spring":header,
"http://activemq.apache.org/camel/schema/
spring":jxpath,
"http://activemq.apache.org/camel/schema/spring":javaScript, "http://
activemq.apache.org/camel/schema/spring":expression,
"http://activemq.apache.org/camel/
schema/spring":methodCall,
"http://activemq.apache.org/camel/schema/spring":ognl, "http://
activemq.apache.org/camel/schema/spring":php,
"http://activemq.apache.org/camel/schema/
spring":python, "http://activemq.apache.org/camel/schema/spring":ruby,
"http://
activemq.apache.org/camel/schema/spring":simple,
"http://activemq.apache.org/camel/schema/
spring":sql, "http://activemq.apache.org/camel/schema/spring":xpath,
"http://
activemq.apache.org/camel/schema/spring":xquery}' is expected.
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18509696.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to define a HTTP Post destination in a route in spring
Posted by James Strachan <ja...@gmail.com>.
I'm guessing you're not using 1.4 which should be released soon - try
1.4-SNAPSHOT or building from trunk
2008/7/17 buchnerm <ma...@gmx.at>:
>
>
> Sorry this didnt work: I get the annotation:
>
> cvc-complex-type.2.4.a: Invalid content was found starting with element
> 'setHeader'. One of
> '{"http://activemq.apache.org/camel/schema/spring":from,
> "http://activemq.apache.org/camel/
> schema/spring":aggregator,
> "http://activemq.apache.org/camel/schema/spring":bean, "http://
> activemq.apache.org/camel/schema/spring":catch,
> "http://activemq.apache.org/camel/schema/
> spring":choice, "http://activemq.apache.org/camel/schema/spring":when,
> "http://
> activemq.apache.org/camel/schema/spring":otherwise,
> "http://activemq.apache.org/camel/
> schema/spring":delayer,
> "http://activemq.apache.org/camel/schema/spring":onException, "http://
> activemq.apache.org/camel/schema/spring":filter,
> "http://activemq.apache.org/camel/schema/
> spring":finally,
> "http://activemq.apache.org/camel/schema/spring":idempotentConsumer,
> "http://
> activemq.apache.org/camel/schema/spring":intercept,
> "http://activemq.apache.org/camel/schema/
> spring":interceptor,
> "http://activemq.apache.org/camel/schema/spring":loadBalance, "http://
> activemq.apache.org/camel/schema/spring":marshal,
> "http://activemq.apache.org/camel/schema/
> spring":multicast, "http://activemq.apache.org/camel/schema/spring":policy,
> "http://
> activemq.apache.org/camel/schema/spring":proceed,
> "http://activemq.apache.org/camel/schema/
> spring":process,
> "http://activemq.apache.org/camel/schema/spring":recipientList, "http://
> activemq.apache.org/camel/schema/spring":resequencer,
> "http://activemq.apache.org/camel/
> schema/spring":route,
> "http://activemq.apache.org/camel/schema/spring":routingSlip, "http://
> activemq.apache.org/camel/schema/spring":splitter,
> "http://activemq.apache.org/camel/schema/
> spring":thread, "http://activemq.apache.org/camel/schema/spring":throttler,
> "http://
> activemq.apache.org/camel/schema/spring":throwFault,
> "http://activemq.apache.org/camel/
> schema/spring":to, "http://activemq.apache.org/camel/schema/spring":try,
> "http://
> activemq.apache.org/camel/schema/spring":unmarshal}' is expected.
>
> Need help on this thanks max
>
>
> buchnerm wrote:
>>
>> this is the example on the camel site how to create a HTTP component:
>>
>> new RouteBuilder() {
>> public void configure() {
>> from("direct:start")
>>
>> .setHeader(org.apache.camel.component.http.HttpMethods.HTTP_METHOD,
>> org.apache.camel.component.http.HttpMethods.POST)
>> .to("http://www.google.com");
>> }
>> };
>>
>> How to do the same in spring???
>>
>> <route>
>> <from uri="direct:in" />
>> <to uri="http:localhost:8080/test.jsp" />
>> </route>
>>
>> How to tell him to send it via post??
>>
>> Thanks Max
>>
>
> --
> View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18506676.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
RE: How to define a HTTP Post destination in a route in spring
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Ah
What version of Camel are you using?
setHeader could have been added to the 1.4.
The XSD reference is here:
http://activemq.apache.org/camel/xml-reference.html
Yes it was added to 1.4. So I assume you are using Camel 1.3 or older.
If so then you could add a process as a workaround and add the setHeader in the Java cod, as the workaround. Sorry I am afraid that there isn't a spring XML solution. The XML builders is lacking behind the Java DSL that has the full power.
Or have patience and upgrade to Camel 1.4 that is soon released.
There is a RC you can try:
The staging area is at:
http://people.apache.org/~hadrian/apache-camel-1.4.0-RC4/maven2
The tarballs are here:
http://people.apache.org/~hadrian/apache-camel-1.4.0-RC4/maven2/org/apache/camel/apache-camel/1.4.0/
Or if you are using maven you can jump on the 1.4-SNAPSHOTS.
http://activemq.apache.org/camel/download.html
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: buchnerm [mailto:markus.buchner@gmx.at]
Sent: 17. juli 2008 13:47
To: camel-user@activemq.apache.org
Subject: Re: How to define a HTTP Post destination in a route in spring
Sorry this didnt work: I get the annotation:
cvc-complex-type.2.4.a: Invalid content was found starting with element
'setHeader'. One of
'{"http://activemq.apache.org/camel/schema/spring":from,
"http://activemq.apache.org/camel/
schema/spring":aggregator,
"http://activemq.apache.org/camel/schema/spring":bean, "http://
activemq.apache.org/camel/schema/spring":catch,
"http://activemq.apache.org/camel/schema/
spring":choice, "http://activemq.apache.org/camel/schema/spring":when,
"http://
activemq.apache.org/camel/schema/spring":otherwise,
"http://activemq.apache.org/camel/
schema/spring":delayer,
"http://activemq.apache.org/camel/schema/spring":onException, "http://
activemq.apache.org/camel/schema/spring":filter,
"http://activemq.apache.org/camel/schema/
spring":finally,
"http://activemq.apache.org/camel/schema/spring":idempotentConsumer,
"http://
activemq.apache.org/camel/schema/spring":intercept,
"http://activemq.apache.org/camel/schema/
spring":interceptor,
"http://activemq.apache.org/camel/schema/spring":loadBalance, "http://
activemq.apache.org/camel/schema/spring":marshal,
"http://activemq.apache.org/camel/schema/
spring":multicast, "http://activemq.apache.org/camel/schema/spring":policy,
"http://
activemq.apache.org/camel/schema/spring":proceed,
"http://activemq.apache.org/camel/schema/
spring":process,
"http://activemq.apache.org/camel/schema/spring":recipientList, "http://
activemq.apache.org/camel/schema/spring":resequencer,
"http://activemq.apache.org/camel/
schema/spring":route,
"http://activemq.apache.org/camel/schema/spring":routingSlip, "http://
activemq.apache.org/camel/schema/spring":splitter,
"http://activemq.apache.org/camel/schema/
spring":thread, "http://activemq.apache.org/camel/schema/spring":throttler,
"http://
activemq.apache.org/camel/schema/spring":throwFault,
"http://activemq.apache.org/camel/
schema/spring":to, "http://activemq.apache.org/camel/schema/spring":try,
"http://
activemq.apache.org/camel/schema/spring":unmarshal}' is expected.
Need help on this thanks max
buchnerm wrote:
>
> this is the example on the camel site how to create a HTTP component:
>
> new RouteBuilder() {
> public void configure() {
> from("direct:start")
>
> .setHeader(org.apache.camel.component.http.HttpMethods.HTTP_METHOD,
> org.apache.camel.component.http.HttpMethods.POST)
> .to("http://www.google.com");
> }
> };
>
> How to do the same in spring???
>
> <route>
> <from uri="direct:in" />
> <to uri="http:localhost:8080/test.jsp" />
> </route>
>
> How to tell him to send it via post??
>
> Thanks Max
>
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18506676.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to define a HTTP Post destination in a route in spring
Posted by buchnerm <ma...@gmx.at>.
Sorry this didnt work: I get the annotation:
cvc-complex-type.2.4.a: Invalid content was found starting with element
'setHeader'. One of
'{"http://activemq.apache.org/camel/schema/spring":from,
"http://activemq.apache.org/camel/
schema/spring":aggregator,
"http://activemq.apache.org/camel/schema/spring":bean, "http://
activemq.apache.org/camel/schema/spring":catch,
"http://activemq.apache.org/camel/schema/
spring":choice, "http://activemq.apache.org/camel/schema/spring":when,
"http://
activemq.apache.org/camel/schema/spring":otherwise,
"http://activemq.apache.org/camel/
schema/spring":delayer,
"http://activemq.apache.org/camel/schema/spring":onException, "http://
activemq.apache.org/camel/schema/spring":filter,
"http://activemq.apache.org/camel/schema/
spring":finally,
"http://activemq.apache.org/camel/schema/spring":idempotentConsumer,
"http://
activemq.apache.org/camel/schema/spring":intercept,
"http://activemq.apache.org/camel/schema/
spring":interceptor,
"http://activemq.apache.org/camel/schema/spring":loadBalance, "http://
activemq.apache.org/camel/schema/spring":marshal,
"http://activemq.apache.org/camel/schema/
spring":multicast, "http://activemq.apache.org/camel/schema/spring":policy,
"http://
activemq.apache.org/camel/schema/spring":proceed,
"http://activemq.apache.org/camel/schema/
spring":process,
"http://activemq.apache.org/camel/schema/spring":recipientList, "http://
activemq.apache.org/camel/schema/spring":resequencer,
"http://activemq.apache.org/camel/
schema/spring":route,
"http://activemq.apache.org/camel/schema/spring":routingSlip, "http://
activemq.apache.org/camel/schema/spring":splitter,
"http://activemq.apache.org/camel/schema/
spring":thread, "http://activemq.apache.org/camel/schema/spring":throttler,
"http://
activemq.apache.org/camel/schema/spring":throwFault,
"http://activemq.apache.org/camel/
schema/spring":to, "http://activemq.apache.org/camel/schema/spring":try,
"http://
activemq.apache.org/camel/schema/spring":unmarshal}' is expected.
Need help on this thanks max
buchnerm wrote:
>
> this is the example on the camel site how to create a HTTP component:
>
> new RouteBuilder() {
> public void configure() {
> from("direct:start")
>
> .setHeader(org.apache.camel.component.http.HttpMethods.HTTP_METHOD,
> org.apache.camel.component.http.HttpMethods.POST)
> .to("http://www.google.com");
> }
> };
>
> How to do the same in spring???
>
> <route>
> <from uri="direct:in" />
> <to uri="http:localhost:8080/test.jsp" />
> </route>
>
> How to tell him to send it via post??
>
> Thanks Max
>
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18506676.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: How to define a HTTP Post destination in a route in spring (solved)
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi
Yep that was the error. Maybe we should add some validation to the jetty component that if the url starts with http or https again then it's a failure and we could provide a better exception message.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: buchnerm [mailto:markus.buchner@gmx.at]
Sent: 18. juli 2008 13:08
To: camel-user@activemq.apache.org
Subject: Re: How to define a HTTP Post destination in a route in spring (solved)
Sorry solved my fault:
had twice http in the uri!!
This works:
<route>
<from uri="direct:in" />
<setHeader headerName="http.requestMethod" value="POST">
<simple />
</setHeader>
<to uri="http://192.168.1.102:8888/test.jsp" />
</route>
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18526981.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to define a HTTP Post destination in a route in spring
Posted by buchnerm <ma...@gmx.at>.
Sorry solved my fault:
had twice http in the uri!!
This works:
<route>
<from uri="direct:in" />
<setHeader headerName="http.requestMethod" value="POST">
<simple />
</setHeader>
<to uri="http://192.168.1.102:8888/test.jsp" />
</route>
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18526981.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to define a HTTP Post destination in a route in spring
Posted by buchnerm <ma...@gmx.at>.
Hi
the example you put online in the doc now doesnt work
************************************
And the equivalent spring sample:
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="direct:start"/>
<setHeader headerName="http.requestMethod" value="POST"/>
<to uri="http://www.google.com"/>
<to uri="mock:results"/>
</route>
</camelContext>
************************************
At the moment I have this valid configuration with camel 1.4
<route>
<from uri="direct:in" />
<setHeader headerName="http.requestMethod" value="POST">
<simple />
</setHeader>
<to uri="http:http://192.168.1.102:8888/test.jsp" />
</route>
but I get the following error! Please I need support -
2008-07-17 17:39:24,203 ERROR [DefaultMessageListenerContainer-1036]
org.apache.camel.processor.DeadLetterChannel: Failed delivery for
exchangeId: ID-power/2149-1216309145187/0-7771. On delivery attempt: 0
caught: java.lang.IllegalArgumentException: Host name may not be null
java.lang.IllegalArgumentException: Host name may not be null
at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:68)
at org.apache.commons.httpclient.HttpHost.<init>(HttpHost.java:107)
at
org.apache.commons.httpclient.HttpMethodBase.setURI(HttpMethodBase.java:280)
at
org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:220)
at
org.apache.commons.httpclient.methods.ExpectContinueMethod.<init>(ExpectContinueMethod.java:93)
at
org.apache.commons.httpclient.methods.EntityEnclosingMethod.<init>(EntityEnclosingMethod.java:119)
at
org.apache.commons.httpclient.methods.PostMethod.<init>(PostMethod.java:106)
at
org.apache.camel.component.http.HttpProducer.createMethod(HttpProducer.java:97)
at
org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:48)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:73)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:45)
at
org.apache.camel.util.ProducerCache.sendExchange(ProducerCache.java:147)
at org.apache.camel.util.ProducerCache.send(ProducerCache.java:84)
at org.apache.camel.CamelTemplate.send(CamelTemplate.java:119)
at org.apache.camel.CamelTemplate.sendBody(CamelTemplate.java:170)
at org.apache.camel.CamelTemplate.sendBody(CamelTemplate.java:183)
at
com.fatwire.analytics.service.InterceptorService.process(InterceptorService.java:69)
at
com.fatwire.analytics.service.InterceptorService.process(InterceptorService.java:1)
at
com.fatwire.analytics.camel.processor.ServiceProcessor.process(ServiceProcessor.java:20)
at
org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:72)
at
org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:50)
at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:73)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:66)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:316)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:887)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
at java.lang.Thread.run(Thread.java:595)
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18525626.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: How to define a HTTP Post destination in a route in spring
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi
Yes this component is actually not spring friendly when it comes to the method. We should improve this. Will create a JIRA ticket for it.
I do think its something like this:
<route>
<from uri="direct:in" />
<setHeader headerName="http.requestMethod" value="POST"/>
<to uri="http:localhost:8080/test.jsp" />
</route>
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: buchnerm [mailto:markus.buchner@gmx.at]
Sent: 17. juli 2008 13:16
To: camel-user@activemq.apache.org
Subject: How to define a HTTP Post destination in a route in spring
this is the example on the camel site how to create a HTTP component:
new RouteBuilder() {
public void configure() {
from("direct:start")
.setHeader(org.apache.camel.component.http.HttpMethods.HTTP_METHOD,
org.apache.camel.component.http.HttpMethods.POST)
.to("http://www.google.com");
}
};
How to do the same in spring???
<route>
<from uri="direct:in" />
<to uri="http:localhost:8080/test.jsp" />
</route>
How to tell him to send it via post??
Thanks Max
--
View this message in context: http://www.nabble.com/How-to-define-a-HTTP-Post-destination-in-a-route-in-spring-tp18506233s22882p18506233.html
Sent from the Camel - Users mailing list archive at Nabble.com.