You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by titexe <ti...@yahoo.Fr> on 2010/01/12 15:06:26 UTC

Retrieve BrokerName & Velocity

Hello,

a simple question: 

I want to retrieve the name of the broker to use it after in a component
Velocity?

How to get the system date in velocity?

Thank you in advance.

titexe
-- 
View this message in context: http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Retrieve BrokerName & Velocity

Posted by Willem Jiang <wi...@gmail.com>.
Sorry, I don't think camel find the BrokerName itself.

Maybe you need to try use the property placeholder and pass this setting 
into the camel route, and let the camel route set the message header for 
you.

Willem

titexe wrote:
> I seek to recover the value BrokerName "LAPTOP" which is defined in the file
> activemq.xml
> 
> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="LAPTOP"
> dataDirectory="${activemq.base}/data">
> 
> there's any way to retrieve this value with a component Camel?
> 
> Thanks in advance,
> 
> titexe
> 
> 
> willem.jiang wrote:
>> Hi
>>
>> What kind of BrokerName() do you want to get?
>> Does the message have a header with the name of "BrokerName"?
>>
>> Willem
>>
>> titexe wrote:
>>> Thank you for you reply,
>>>
>>> there's any component in Camel that retrieves the value of BrokerName?
>>>  For example <simple> $ in.header.BrokerName () </ simple>
>>>
>>> How Velocity component retrieves the system date, It's possible to put
>>> just
>>> $ {date} in my VM files $ {date}?
>>>
>>> titexe
>>>
>>>
>>> Claus Ibsen-2 wrote:
>>>> On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>>>>> Hello,
>>>>>
>>>>> a simple question:
>>>>>
>>>>> I want to retrieve the name of the broker to use it after in a
>>>>> component
>>>>> Velocity?
>>>>>
>>>>> How to get the system date in velocity?
>>>>>
>>>> Can you be more precise what you are looking for?
>>>>
>>>> You may want to check the Velocity documentation how to use its
>>>> templating language if you e.g. want to get Date now = new Date()
>>>> dates?
>>>> And how to format it etc.
>>>>
>>>> Basically all the Camel headers is avail so you can grab those as
>>>> well, so you can put a header with the broker name and date and then
>>>> use those in the template.
>>>> See some of the camel unit tests for that.
>>>>
>>>>> Thank you in advance.
>>>>>
>>>>> titexe
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
>>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>>>
>>
>>
> 


Re: Retrieve BrokerName & Velocity

Posted by titexe <ti...@yahoo.Fr>.
I seek to recover the value BrokerName "LAPTOP" which is defined in the file
activemq.xml

<broker xmlns="http://activemq.apache.org/schema/core" brokerName="LAPTOP"
dataDirectory="${activemq.base}/data">

there's any way to retrieve this value with a component Camel?

Thanks in advance,

titexe


willem.jiang wrote:
> 
> Hi
> 
> What kind of BrokerName() do you want to get?
> Does the message have a header with the name of "BrokerName"?
> 
> Willem
> 
> titexe wrote:
>> Thank you for you reply,
>> 
>> there's any component in Camel that retrieves the value of BrokerName?
>>  For example <simple> $ in.header.BrokerName () </ simple>
>> 
>> How Velocity component retrieves the system date, It's possible to put
>> just
>> $ {date} in my VM files $ {date}?
>> 
>> titexe
>> 
>> 
>> Claus Ibsen-2 wrote:
>>> On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>>>> Hello,
>>>>
>>>> a simple question:
>>>>
>>>> I want to retrieve the name of the broker to use it after in a
>>>> component
>>>> Velocity?
>>>>
>>>> How to get the system date in velocity?
>>>>
>>> Can you be more precise what you are looking for?
>>>
>>> You may want to check the Velocity documentation how to use its
>>> templating language if you e.g. want to get Date now = new Date()
>>> dates?
>>> And how to format it etc.
>>>
>>> Basically all the Camel headers is avail so you can grab those as
>>> well, so you can put a header with the broker name and date and then
>>> use those in the template.
>>> See some of the camel unit tests for that.
>>>
>>>> Thank you in advance.
>>>>
>>>> titexe
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>> -- 
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27141588.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Retrieve BrokerName & Velocity

Posted by Willem Jiang <wi...@gmail.com>.
Hi

What kind of BrokerName() do you want to get?
Does the message have a header with the name of "BrokerName"?

Willem

titexe wrote:
> Thank you for you reply,
> 
> there's any component in Camel that retrieves the value of BrokerName?
>  For example <simple> $ in.header.BrokerName () </ simple>
> 
> How Velocity component retrieves the system date, It's possible to put just
> $ {date} in my VM files $ {date}?
> 
> titexe
> 
> 
> Claus Ibsen-2 wrote:
>> On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>>> Hello,
>>>
>>> a simple question:
>>>
>>> I want to retrieve the name of the broker to use it after in a component
>>> Velocity?
>>>
>>> How to get the system date in velocity?
>>>
>> Can you be more precise what you are looking for?
>>
>> You may want to check the Velocity documentation how to use its
>> templating language if you e.g. want to get Date now = new Date()
>> dates?
>> And how to format it etc.
>>
>> Basically all the Camel headers is avail so you can grab those as
>> well, so you can put a header with the broker name and date and then
>> use those in the template.
>> See some of the camel unit tests for that.
>>
>>> Thank you in advance.
>>>
>>> titexe
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> -- 
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
> 


Re: Retrieve BrokerName & Velocity

Posted by titexe <ti...@yahoo.Fr>.
The simplest is to retrieve the Date in the header of the message :

<setHeader headerName="Date">
	<simple>${date:now:yyyy-MM-dd'T'HH:mm:ss:SSS}</simple>
</setHeader>


As against this date format does not work? any idea?

Thank you in advance


Claus Ibsen-2 wrote:
> 
> On Tue, Jan 12, 2010 at 4:14 PM, titexe <ti...@yahoo.fr> wrote:
>>
>> Thank you for you reply,
>>
>> there's any component in Camel that retrieves the value of BrokerName?
>>  For example <simple> $ in.header.BrokerName () </ simple>
>>
>> How Velocity component retrieves the system date, It's possible to put
>> just
>> $ {date} in my VM files $ {date}?
>>
> 
> You can check out the Velocity user guide
> http://velocity.apache.org/engine/releases/velocity-1.6.2/user-guide.html
> 
> And then do a bit of google or look at the Velocity mailinglist.
> 
> And of course do some experiments as well.
> 
> 
>> titexe
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>>>>
>>>> Hello,
>>>>
>>>> a simple question:
>>>>
>>>> I want to retrieve the name of the broker to use it after in a
>>>> component
>>>> Velocity?
>>>>
>>>> How to get the system date in velocity?
>>>>
>>>
>>> Can you be more precise what you are looking for?
>>>
>>> You may want to check the Velocity documentation how to use its
>>> templating language if you e.g. want to get Date now = new Date()
>>> dates?
>>> And how to format it etc.
>>>
>>> Basically all the Camel headers is avail so you can grab those as
>>> well, so you can put a header with the broker name and date and then
>>> use those in the template.
>>> See some of the camel unit tests for that.
>>>
>>>> Thank you in advance.
>>>>
>>>> titexe
>>>> --
>>>> View this message in context:
>>>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
>>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Claus Ibsen
>>> Apache Camel Committer
>>>
>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>> Open Source Integration: http://fusesource.com
>>> Blog: http://davsclaus.blogspot.com/
>>> Twitter: http://twitter.com/davsclaus
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27129089.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27130741.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Retrieve BrokerName & Velocity

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 12, 2010 at 4:14 PM, titexe <ti...@yahoo.fr> wrote:
>
> Thank you for you reply,
>
> there's any component in Camel that retrieves the value of BrokerName?
>  For example <simple> $ in.header.BrokerName () </ simple>
>
> How Velocity component retrieves the system date, It's possible to put just
> $ {date} in my VM files $ {date}?
>

You can check out the Velocity user guide
http://velocity.apache.org/engine/releases/velocity-1.6.2/user-guide.html

And then do a bit of google or look at the Velocity mailinglist.

And of course do some experiments as well.


> titexe
>
>
> Claus Ibsen-2 wrote:
>>
>> On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>>>
>>> Hello,
>>>
>>> a simple question:
>>>
>>> I want to retrieve the name of the broker to use it after in a component
>>> Velocity?
>>>
>>> How to get the system date in velocity?
>>>
>>
>> Can you be more precise what you are looking for?
>>
>> You may want to check the Velocity documentation how to use its
>> templating language if you e.g. want to get Date now = new Date()
>> dates?
>> And how to format it etc.
>>
>> Basically all the Camel headers is avail so you can grab those as
>> well, so you can put a header with the broker name and date and then
>> use those in the template.
>> See some of the camel unit tests for that.
>>
>>> Thank you in advance.
>>>
>>> titexe
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27129089.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Retrieve BrokerName & Velocity

Posted by titexe <ti...@yahoo.Fr>.
Thank you for you reply,

there's any component in Camel that retrieves the value of BrokerName?
 For example <simple> $ in.header.BrokerName () </ simple>

How Velocity component retrieves the system date, It's possible to put just
$ {date} in my VM files $ {date}?

titexe


Claus Ibsen-2 wrote:
> 
> On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>>
>> Hello,
>>
>> a simple question:
>>
>> I want to retrieve the name of the broker to use it after in a component
>> Velocity?
>>
>> How to get the system date in velocity?
>>
> 
> Can you be more precise what you are looking for?
> 
> You may want to check the Velocity documentation how to use its
> templating language if you e.g. want to get Date now = new Date()
> dates?
> And how to format it etc.
> 
> Basically all the Camel headers is avail so you can grab those as
> well, so you can put a header with the broker name and date and then
> use those in the template.
> See some of the camel unit tests for that.
> 
>> Thank you in advance.
>>
>> titexe
>> --
>> View this message in context:
>> http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 

-- 
View this message in context: http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27129089.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Retrieve BrokerName & Velocity

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jan 12, 2010 at 3:06 PM, titexe <ti...@yahoo.fr> wrote:
>
> Hello,
>
> a simple question:
>
> I want to retrieve the name of the broker to use it after in a component
> Velocity?
>
> How to get the system date in velocity?
>

Can you be more precise what you are looking for?

You may want to check the Velocity documentation how to use its
templating language if you e.g. want to get Date now = new Date()
dates?
And how to format it etc.

Basically all the Camel headers is avail so you can grab those as
well, so you can put a header with the broker name and date and then
use those in the template.
See some of the camel unit tests for that.

> Thank you in advance.
>
> titexe
> --
> View this message in context: http://old.nabble.com/Retrieve-BrokerName---Velocity-tp27128040p27128040.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus