You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Lorenz, Stefan" <St...@htw-aalen.de> on 2011/01/18 10:55:46 UTC

ProducerTemplate.sendBody with String[] as Parameter

Hi,

is is possible to send a String[] with a ProducerTemplate?


If I try to to this:

String[] params = new String[2];
...
final ProducerTemplate template = camelContext.createProducerTemplate();
template.sendBody("direct:test", params);

I get a java.net.ConnectException in the template.sendBody line.
If I just use a String it works...

Regrads,
Stefan





AW: ProducerTemplate.sendBody with String[] as Parameter

Posted by "Lorenz, Stefan" <St...@htw-aalen.de>.
Thx,
I solved it,
the error came from a service which was not running....

-----Ursprüngliche Nachricht-----
Von: Claus Ibsen [mailto:claus.ibsen@gmail.com] 
Gesendet: Dienstag, 18. Januar 2011 15:10
An: users@camel.apache.org
Betreff: Re: ProducerTemplate.sendBody with String[] as Parameter

On Tue, Jan 18, 2011 at 10:55 AM, Lorenz, Stefan
<St...@htw-aalen.de> wrote:
> Hi,
>
> is is possible to send a String[] with a ProducerTemplate?
>
>
> If I try to to this:
>
> String[] params = new String[2];
> ...
> final ProducerTemplate template = camelContext.createProducerTemplate();
> template.sendBody("direct:test", params);
>
> I get a java.net.ConnectException in the template.sendBody line.
> If I just use a String it works...
>

Can you post the stacktrace and what version of Camel are you using?

Frankly you should be able to send any kind of payload as its just a
java.lang.Object type.


> Regrads,
> Stefan
>
>
>
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: ProducerTemplate.sendBody with String[] as Parameter

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 18, 2011 at 10:55 AM, Lorenz, Stefan
<St...@htw-aalen.de> wrote:
> Hi,
>
> is is possible to send a String[] with a ProducerTemplate?
>
>
> If I try to to this:
>
> String[] params = new String[2];
> ...
> final ProducerTemplate template = camelContext.createProducerTemplate();
> template.sendBody("direct:test", params);
>
> I get a java.net.ConnectException in the template.sendBody line.
> If I just use a String it works...
>

Can you post the stacktrace and what version of Camel are you using?

Frankly you should be able to send any kind of payload as its just a
java.lang.Object type.


> Regrads,
> Stefan
>
>
>
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/