You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by satspeedy <sa...@hotmail.com> on 2013/05/16 09:06:09 UTC

set string marshal encoding by a property-file

Hi @all,

my purpose is to make the encoding of marshalling configurable in the
following route by a property-file.

.process(new ...Processor())
.marshal().string(simple("${properties:output.encoding}")) // "IBM-273"
.to()...

I've tried it with simple language...but the string(..)-method do not parse
this parameter.

Is there any other way to solve this problem?

Best Regards & thanks beforehand.
satspeedy




--
View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: set string marshal encoding by a property-file

Posted by satspeedy <sa...@hotmail.com>.
Hi Claus,

thanks for your answer...I've resolved it differently...implemented several
routes for any case.
But I'll keep your answer in mind for next time.

Thanks.

Regards
satspeedy




2013/5/17 Claus Ibsen-2 [via Camel] <
ml-node+s465427n5732700h50@n5.nabble.com>

> You can always use the API from CamelContext to parse it, and then set
> the value in the route.
>
> String parsed = camelContext.resolvePropertyPlaceholders("{{xxx}}");
>
> marshal().string(parsed)
>
>
>
> On Thu, May 16, 2013 at 10:19 AM, satspeedy <[hidden email]<http://user/SendEmail.jtp?type=node&node=5732700&i=0>>
> wrote:
>
> > Hi Claus,
> >
> > furthermore same problem...it won't be parsed.
> > Any other possibility to solve it?
> >
> > thanks beforehand.
> > regards
> > satspeedy
> >
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732664.html
>
> > Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> www.camelone.org: The open source integration conference.
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: [hidden email]<http://user/SendEmail.jtp?type=node&node=5732700&i=1>
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732700.html
>  To unsubscribe from set string marshal encoding by a property-file, click
> here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5732657&code=c2F0c3BlZWR5QGhvdG1haWwuY29tfDU3MzI2NTd8NDU5OTczNDUz>
> .
> 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>
>



-- 
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail sind nicht gestattet. Über das Internet versandte
Emails können leicht unter fremden Namen erstellt oder manipuliert werden.
Aus diesem Grunde bitten wir um Verständnis, dass wir zu Ihrem und unserem
Schutz die rechtliche Verbindlichkeit der vorstehenden Erklärungen und
Äußerungen ausschließen.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient or have received this e-mail in error,
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
E-mails via Internet can easily be prepared or manipulated by third
persons. For this reason we trust you will understand that, for your own
and our protection, we rule out the legal validity of the foregoing
statements and comments.




--
View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732926.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: set string marshal encoding by a property-file

Posted by Claus Ibsen <cl...@gmail.com>.
You can always use the API from CamelContext to parse it, and then set
the value in the route.

String parsed = camelContext.resolvePropertyPlaceholders("{{xxx}}");

marshal().string(parsed)



On Thu, May 16, 2013 at 10:19 AM, satspeedy <sa...@hotmail.com> wrote:
> Hi Claus,
>
> furthermore same problem...it won't be parsed.
> Any other possibility to solve it?
>
> thanks beforehand.
> regards
> satspeedy
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732664.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: set string marshal encoding by a property-file

Posted by satspeedy <sa...@hotmail.com>.
Hi Claus,

furthermore same problem...it won't be parsed.
Any other possibility to solve it?

thanks beforehand.
regards
satspeedy




--
View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732664.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: set string marshal encoding by a property-file

Posted by Claus Ibsen <cl...@gmail.com>.
Try with

org.apache.camel.model.dataformat.StringDataFormat sdf = new StringDataFormat();
sdf.setCharset("{{xxxx}}");

And in the route

.marshal(sdf)


On Thu, May 16, 2013 at 9:41 AM, satspeedy <sa...@hotmail.com> wrote:
> Hi Claus,
>
> thanks for your answer...placeholders aren't supported, too.
>
> Any other possibility to solve it?
>
> Regards
> satspeedy
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732660.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: set string marshal encoding by a property-file

Posted by satspeedy <sa...@hotmail.com>.
Hi Claus,

thanks for your answer...placeholders aren't supported, too.

Any other possibility to solve it?

Regards
satspeedy



--
View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657p5732660.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: set string marshal encoding by a property-file

Posted by Claus Ibsen <cl...@gmail.com>.
Try with

.marshal().string("{{output.encoding}}")

Though not sure if we support the placeholders there, but give it a try first.

On Thu, May 16, 2013 at 9:06 AM, satspeedy <sa...@hotmail.com> wrote:
> Hi @all,
>
> my purpose is to make the encoding of marshalling configurable in the
> following route by a property-file.
>
> .process(new ...Processor())
> .marshal().string(simple("${properties:output.encoding}")) // "IBM-273"
> .to()...
>
> I've tried it with simple language...but the string(..)-method do not parse
> this parameter.
>
> Is there any other way to solve this problem?
>
> Best Regards & thanks beforehand.
> satspeedy
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/set-string-marshal-encoding-by-a-property-file-tp5732657.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen