You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dkum003 <DH...@amadeus.com> on 2013/10/23 15:32:58 UTC

how to give the dynamic value to the tokenizeXML

Hi,

I want to give the dynamic value to the tokenizeXML.

My code snippet is below:

.split()
.tokenizeXML(tokenType, 100)
.streaming()

Here my requirement to change the value of tokenType for every run.

Thanks & Regards,
Dhananjay Kumar
Amadeus Lab
SSE



--
View this message in context: http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to give the dynamic value to the tokenizeXML

Posted by contactreji <co...@gmail.com>.
Hi Kumar

You can have  logic to calculate it in components like processor and add it
to the exchange header.. And later in splitter component, you can refer the
value from header using {in.header.tokenNameFromHeader}

Look out for more ideas from forums users too!

Cheers
Reji


On Wed, Oct 23, 2013 at 6:32 AM, dkum003 [via Camel] <
ml-node+s465427n5742075h4@n5.nabble.com> wrote:

> Hi,
>
> I want to give the dynamic value to the tokenizeXML.
>
> My code snippet is below:
>
> .split()
> .tokenizeXML(tokenType, 100)
> .streaming()
>
> Here my requirement to change the value of tokenType for every run.
>
> Thanks & Regards,
> Dhananjay Kumar
> Amadeus Lab
> SSE
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075.html
>  To unsubscribe from Camel - Users, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=Y29udGFjdHJlamlAZ21haWwuY29tfDQ2NTQyOHwxMDA0OTE4MjMz>
> .
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075p5742092.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to give the dynamic value to the tokenizeXML

Posted by Claus Ibsen <cl...@gmail.com>.
You would need to use java code where you can dynamic set the token
and return the tokenizer

.split().method(MyBean.class, "myMethod")

And then implement the method

public static Expression myMethod(Exchange exchange) {
   ...

     TokenizeLanguage tok = new TokenizeLanguage();
      tok.setXml(true);
      tok.setIncludeTokens(true);
      tok.setGroup(100);

      tok.setToken(Here is my string as the token I wanna use);


      return tok.createExpression(exchange);
}

On Wed, Oct 23, 2013 at 3:32 PM, dkum003 <DH...@amadeus.com> wrote:
> Hi,
>
> I want to give the dynamic value to the tokenizeXML.
>
> My code snippet is below:
>
> .split()
> .tokenizeXML(tokenType, 100)
> .streaming()
>
> Here my requirement to change the value of tokenType for every run.
>
> Thanks & Regards,
> Dhananjay Kumar
> Amadeus Lab
> SSE
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-give-the-dynamic-value-to-the-tokenizeXML-tp5742075.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen