You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ravi Nallappan <ra...@gmail.com> on 2016/01/26 08:55:11 UTC

CAMEL-8983: Question regarding Camel Simple Random()

Hi,

 

Is it possible to make this function work based on content?

 

i.e 

.setBody(simple("random(${body})"))

 

 

Thanks and regards,

Ravi Nallappan


Re: CAMEL-8983: Question regarding Camel Simple Random()

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 4, 2016 at 7:42 PM, Walzer, Thomas
<th...@integratix.net> wrote:
> As you are already using the java dsl: use a bean or write a processor that does exactly what you want. Then use that.
> As body could be anything (Object) I would find it challenging to implement this in simple language (what´s a random object?).You probably only want this for numbers (most probably: integers).
>

Yes exactly. The simple function with integers that was added to the
language was intended for easily create a random number you may use as
part of unit testing or demoing or something. Or if you really want to
generate a random number in a production route, from eg xml route etc.



> Cheers, Thomas.
>
>> Am 26.01.2016 um 08:55 schrieb Ravi Nallappan <ra...@gmail.com>:
>>
>> Hi,
>>
>>
>>
>> Is it possible to make this function work based on content?
>>
>>
>>
>> i.e
>>
>> .setBody(simple("random(${body})"))
>>
>>
>>
>>
>>
>> Thanks and regards,
>>
>> Ravi Nallappan
>>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: CAMEL-8983: Question regarding Camel Simple Random()

Posted by "Walzer, Thomas" <th...@integratix.net>.
As you are already using the java dsl: use a bean or write a processor that does exactly what you want. Then use that.
As body could be anything (Object) I would find it challenging to implement this in simple language (what´s a random object?).You probably only want this for numbers (most probably: integers).

Cheers, Thomas.

> Am 26.01.2016 um 08:55 schrieb Ravi Nallappan <ra...@gmail.com>:
> 
> Hi,
> 
> 
> 
> Is it possible to make this function work based on content?
> 
> 
> 
> i.e 
> 
> .setBody(simple("random(${body})"))
> 
> 
> 
> 
> 
> Thanks and regards,
> 
> Ravi Nallappan
>