You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Pavlo Fenoga <pf...@gmail.com> on 2008/02/13 12:07:51 UTC

How to use envir. variables in xbean.xml

Hello!

Is it possible to avoid using real values of component properties in
xbean.xml files?
Instead I would like to use e.g. environment variables or some other
properties that can be resolved in runtime.
E.g. 
  <http:endpoint service="tut:httpSender"
                 endpoint="soapSender"
                 role="provider" 
                 locationURI="$WS_URL"
                 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                 soap="false" />             

$WS_URL – will be replaced by real location URI of web serice

  <file:sender service="tut:file" 
             endpoint="sender"
             directory="$OUT_DIR" />

$OUT_DIR – will be replaced by the real directory path.

Thank you

-- 
View this message in context: http://www.nabble.com/How-to-use-envir.-variables-in-xbean.xml-tp15454843s12049p15454843.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to use envir. variables in xbean.xml

Posted by Bruce Snyder <br...@gmail.com>.
On Feb 13, 2008 5:55 AM, Daryl Richter <ng...@comcast.net> wrote:
> Pavlo-
>
> You can do this as follows.  In your xbean you have:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans
>     xmlns:core="http://adomain.com/core/1.0"
>     xmlns:sm="http://servicemix.apache.org/config/1.0"
>     xmlns:jms="http://servicemix.apache.org/jms/1.0">
>
>     <bean id="propertyConfigurer"
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfi
> gurer">
>        <property name="location" value="classpath:my.ini"/>
>     </bean>
>
>     <jms:endpoint service="core:logger" endpoint="ep"
>        connectionFactory="#ConnectionFactory"
>        defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
>        destinationStyle="topic"
>        jmsProviderDestinationName="${configured.topic.name}"
>        role="provider"/>
>
> </beans>

Daryl is exactly correct - use the Spring
PropertyPlaceholderConfigurer for environment variables and properties
files.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: How to use envir. variables in xbean.xml

Posted by Daryl Richter <ng...@comcast.net>.
Pavlo-

You can do this as follows.  In your xbean you have:

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns:core="http://adomain.com/core/1.0"
    xmlns:sm="http://servicemix.apache.org/config/1.0"
    xmlns:jms="http://servicemix.apache.org/jms/1.0">

    <bean id="propertyConfigurer"  
class="org.springframework.beans.factory.config.PropertyPlaceholderConfi 
gurer">
       <property name="location" value="classpath:my.ini"/>
    </bean>

    <jms:endpoint service="core:logger" endpoint="ep"
       connectionFactory="#ConnectionFactory"
       defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
       destinationStyle="topic"
       jmsProviderDestinationName="${configured.topic.name}"
       role="provider"/>

</beans>

and then somewhere in your su classpath, it can be the servicemix  
conf/ dir, you put my.ini with the following line:

configured.topic.name = my.topic

This will be read at SU deployment time.


On Feb 13, 2008, at 6:07 AM, Pavlo Fenoga wrote:

>
> Hello!
>
> Is it possible to avoid using real values of component properties in
> xbean.xml files?
> Instead I would like to use e.g. environment variables or some other
> properties that can be resolved in runtime.
> E.g.
>   <http:endpoint service="tut:httpSender"
>                  endpoint="soapSender"
>                  role="provider"
>                  locationURI="$WS_URL"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                  soap="false" />
>
> $WS_URL – will be replaced by real location URI of web serice
>
>   <file:sender service="tut:file"
>              endpoint="sender"
>              directory="$OUT_DIR" />
>
> $OUT_DIR – will be replaced by the real directory path.
>
> Thank you
>
> -- 
> View this message in context: http://www.nabble.com/How-to-use- 
> envir.-variables-in-xbean.xml-tp15454843s12049p15454843.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>

-- 
Daryl
http://itsallsemantics.com

"You can't get a suntan on the moon
  But I wouldn't mind a holiday there."
     -- Love And Rockets






Re: How to use envir. variables in xbean.xml

Posted by Pavlo Fenoga <pf...@gmail.com>.
Thank you for answer!



lhe wrote:
> 
> Pavlo,
> 
> you can have a look at the servicemix.xml in the conf folder.
> Also in the examples folder there are examples which make
> use of the static configuration.
> But especially the servicemix.xml in the conf folder is interesting
> because it uses variables defined in the servicemix.properties file.
> 
> As I am not using the static configuration at all I am maybe not the
> best person to talk about details. :)
> 
> Regards,
> Lars
> 
> 
> 
> 
> Pavlo Fenoga schrieb:
>> Lars, thank you for fast respond!
>>
>> Could you please give an example of such configuration with variables.
>>
>> Thank you.
>>
>> Pavlo.
>>
>>
>>
>> lhe wrote:
>>   
>>> Pavlo,
>>>
>>> as far as I know this is only possible when you use the static
>>> configuration for setting up servicemix. If you want to deploy
>>> to servicemix via the hotdeploy folder, then this will not work.
>>> (at least I do not know how to do it)
>>>
>>> Regards,
>>> Lars
>>>
>>>
>>>
>>>
>>> Pavlo Fenoga schrieb:
>>>     
>>>> Hello!
>>>>
>>>> Is it possible to avoid using real values of component properties in
>>>> xbean.xml files?
>>>> Instead I would like to use e.g. environment variables or some other
>>>> properties that can be resolved in runtime.
>>>> E.g. 
>>>>   <http:endpoint service="tut:httpSender"
>>>>                  endpoint="soapSender"
>>>>                  role="provider" 
>>>>                  locationURI="$WS_URL"
>>>>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>>                  soap="false" />             
>>>>
>>>> $WS_URL – will be replaced by real location URI of web serice
>>>>
>>>>   <file:sender service="tut:file" 
>>>>              endpoint="sender"
>>>>              directory="$OUT_DIR" />
>>>>
>>>> $OUT_DIR – will be replaced by the real directory path.
>>>>
>>>> Thank you
>>>>
>>>>   
>>>>       
>>>     
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-envir.-variables-in-xbean.xml-tp15454843s12049p15465686.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to use envir. variables in xbean.xml

Posted by Lars Heinemann <la...@compart.net>.
Pavlo,

you can have a look at the servicemix.xml in the conf folder.
Also in the examples folder there are examples which make
use of the static configuration.
But especially the servicemix.xml in the conf folder is interesting
because it uses variables defined in the servicemix.properties file.

As I am not using the static configuration at all I am maybe not the
best person to talk about details. :)

Regards,
Lars




Pavlo Fenoga schrieb:
> Lars, thank you for fast respond!
>
> Could you please give an example of such configuration with variables.
>
> Thank you.
>
> Pavlo.
>
>
>
> lhe wrote:
>   
>> Pavlo,
>>
>> as far as I know this is only possible when you use the static
>> configuration for setting up servicemix. If you want to deploy
>> to servicemix via the hotdeploy folder, then this will not work.
>> (at least I do not know how to do it)
>>
>> Regards,
>> Lars
>>
>>
>>
>>
>> Pavlo Fenoga schrieb:
>>     
>>> Hello!
>>>
>>> Is it possible to avoid using real values of component properties in
>>> xbean.xml files?
>>> Instead I would like to use e.g. environment variables or some other
>>> properties that can be resolved in runtime.
>>> E.g. 
>>>   <http:endpoint service="tut:httpSender"
>>>                  endpoint="soapSender"
>>>                  role="provider" 
>>>                  locationURI="$WS_URL"
>>>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>>                  soap="false" />             
>>>
>>> $WS_URL – will be replaced by real location URI of web serice
>>>
>>>   <file:sender service="tut:file" 
>>>              endpoint="sender"
>>>              directory="$OUT_DIR" />
>>>
>>> $OUT_DIR – will be replaced by the real directory path.
>>>
>>> Thank you
>>>
>>>   
>>>       
>>     
>
>   

Re: How to use envir. variables in xbean.xml

Posted by Pavlo Fenoga <pf...@gmail.com>.

Lars, thank you for fast respond!

Could you please give an example of such configuration with variables.

Thank you.

Pavlo.



lhe wrote:
> 
> Pavlo,
> 
> as far as I know this is only possible when you use the static
> configuration for setting up servicemix. If you want to deploy
> to servicemix via the hotdeploy folder, then this will not work.
> (at least I do not know how to do it)
> 
> Regards,
> Lars
> 
> 
> 
> 
> Pavlo Fenoga schrieb:
>> Hello!
>>
>> Is it possible to avoid using real values of component properties in
>> xbean.xml files?
>> Instead I would like to use e.g. environment variables or some other
>> properties that can be resolved in runtime.
>> E.g. 
>>   <http:endpoint service="tut:httpSender"
>>                  endpoint="soapSender"
>>                  role="provider" 
>>                  locationURI="$WS_URL"
>>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>                  soap="false" />             
>>
>> $WS_URL – will be replaced by real location URI of web serice
>>
>>   <file:sender service="tut:file" 
>>              endpoint="sender"
>>              directory="$OUT_DIR" />
>>
>> $OUT_DIR – will be replaced by the real directory path.
>>
>> Thank you
>>
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-use-envir.-variables-in-xbean.xml-tp15454843s12049p15455622.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: How to use envir. variables in xbean.xml

Posted by Lars Heinemann <la...@compart.net>.
Pavlo,

as far as I know this is only possible when you use the static
configuration for setting up servicemix. If you want to deploy
to servicemix via the hotdeploy folder, then this will not work.
(at least I do not know how to do it)

Regards,
Lars




Pavlo Fenoga schrieb:
> Hello!
>
> Is it possible to avoid using real values of component properties in
> xbean.xml files?
> Instead I would like to use e.g. environment variables or some other
> properties that can be resolved in runtime.
> E.g. 
>   <http:endpoint service="tut:httpSender"
>                  endpoint="soapSender"
>                  role="provider" 
>                  locationURI="$WS_URL"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                  soap="false" />             
>
> $WS_URL – will be replaced by real location URI of web serice
>
>   <file:sender service="tut:file" 
>              endpoint="sender"
>              directory="$OUT_DIR" />
>
> $OUT_DIR – will be replaced by the real directory path.
>
> Thank you
>
>