Re: Blueprint and property placeholder

2016-09-22 Thread Matt Pavlovich

update-strategy="none" will stop automatic reload of _all_ properties. There is 
not a way to indicate partial update, since all the beans are restarted when a 
configuration change occurs.


On 9/20/16 1:43 PM, dpravin wrote:

Hello All,

We have some common properties, not integration/bundle specific. Can
multiple routes/bundles refer to these property files from blueprint using
cm:property-placeholder?

I also found out that if you have set update-strategy="reload" the bundle
get restarted irrespective of the property being used by the bundle. Is this
the default behavior? Is there anything that can help avoid reload/restart
of bundle if the property is not used?

Thanks,
Pravin



--
View this message in context: 
http://camel.465427.n5.nabble.com/Blueprint-and-property-placeholder-tp5787763.html
Sent from the Camel - Users mailing list archive at Nabble.com.




Re: Blueprint and property placeholder

2016-09-21 Thread Brad Johnson
I don't believe the same properties can be used by multiple bundles yet.  I
think it's in the specification but isn't implemented in Aries yet.

Anyone out there that knows otherwise please correct.

On Tue, Sep 20, 2016 at 12:43 PM, dpravin <pravin.deshm...@gmail.com> wrote:

> Hello All,
>
> We have some common properties, not integration/bundle specific. Can
> multiple routes/bundles refer to these property files from blueprint using
> cm:property-placeholder?
>
> I also found out that if you have set update-strategy="reload" the bundle
> get restarted irrespective of the property being used by the bundle. Is
> this
> the default behavior? Is there anything that can help avoid reload/restart
> of bundle if the property is not used?
>
> Thanks,
> Pravin
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Blueprint-and-property-placeholder-tp5787763.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Blueprint and property placeholder

2016-09-21 Thread dpravin
Hello All,

We have some common properties, not integration/bundle specific. Can
multiple routes/bundles refer to these property files from blueprint using
cm:property-placeholder?

I also found out that if you have set update-strategy="reload" the bundle
get restarted irrespective of the property being used by the bundle. Is this
the default behavior? Is there anything that can help avoid reload/restart
of bundle if the property is not used?

Thanks,
Pravin 



--
View this message in context: 
http://camel.465427.n5.nabble.com/Blueprint-and-property-placeholder-tp5787763.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Reference OSGI Blueprint java.util.Properties service in Blueprint Camel property placeholder

2013-05-22 Thread Willem.Jiang
Hi 

I just have some time to revisit this issue and found you'd better to
leverage the configure admin service which suppose to related the bundle
when the configuration is changed. It will more powerful then you just pass
the properties through the OSGi service.

Willem



--
View this message in context: 
http://camel.465427.n5.nabble.com/Reference-OSGI-Blueprint-java-util-Properties-service-in-Blueprint-Camel-property-placeholder-tp5726985p5732991.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Reference OSGI Blueprint java.util.Properties service in Blueprint Camel property placeholder

2013-02-13 Thread CharlieD
Willem, 

I did add: reference id=vmProperties interface=java.util.Properties/

However it cannot resolve the property. It is as if it can find the service
yet the properties are not there.
Caused by: java.lang.IllegalArgumentException: Property with key
[customer.event.endpoint] not found in properties from text:
{{customer.event.endpoint}}


Claus, yes I am using two separate bundles.


In my Java/Blueprint solution I put something like this:

reference id=vmProperties interface=java.util.Properties/
bean id=myRoute class=com.myapp.MyRoute
   property name=props ref=vmProperties/
/bean

MyRoute extends RouteBuilder and has a class member named props.
  
   private Properties props;

   public Properties getProps() {
 return props;
   }

   public void setProps(Properties props) {
 this.props = props;
   }

I then have some code logic and this solution works as I mentioned in my
first post. I can use that but wanted to see if the communal genius knew of
a better way. What solutions are out there for shared properties so that the
only related bundles need restart? I'm looking for granularity of control.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Reference-OSGI-Blueprint-java-util-Properties-service-in-Blueprint-Camel-property-placeholder-tp5726985p5727538.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Reference OSGI Blueprint java.util.Properties service in Blueprint Camel property placeholder

2013-02-07 Thread Claus Ibsen
 not
 found in registry
 ...
 Caused by: java.io.FileNotFoundException: Properties vmProperties not found
 in registry




 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Reference-OSGI-Blueprint-java-util-Properties-service-in-Blueprint-Camel-property-placeholder-tp5726985.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



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


Reference OSGI Blueprint java.util.Properties service in Blueprint Camel property placeholder

2013-02-05 Thread CharlieD
I want to have centralized shared properties (shared across camel contexts)
to define things, particularly ActiveMQ endpoints. Furthermore, I want to
avoid using /etc/custom.properties, unless I'm unaware of a refresh
mechanism that doesn't require restarting karaf and therefore all bundles. A
point of consideration here is that if I were to use this for endpoints, I
would have to restart the bundles producing to and consuming from them in
order to get changed property values. This is true. It still seems more
concise than bouncing the whole VM and all bundles to get the new
properties.

Here's what I know I can do as a solution:
I am able to reference a java.util.Properties service in one bundle when I
inject it as a property on a bean such as a class that extends RouteBuilder
in another bundle. This is perfectly viable, just not as elegant as I'd
like.

Here's what I think I should be able to do as a solution:
It appears I should be able to reference the service since it represents a
java.util.Properties object through the property placeholder thereby using
only the replacement capabilities in Camel, such as {{event.endpoint}}
whether in Blueprint DSL or in Java. Ultimately I'm trying not to have to
have some Java code to access shared properties. 

I've actually tried a few permutations of the following xml snippets but
this demonstrates exactly what I'm trying to accomplish. After these
snippets I've posted some of the stack trace from karaf. I'm a little
confused why it's throwing a FileNotFoundException. I guess a subordinate
question is, does there need to be a concrete properties file somewhere or
do I possibly lack the setup of a proper Registry (see
http://camel.apache.org/using-propertyplaceholder.html under Using
Properties from the Registry section). If am missing something on the
registry maybe I need to do a little more reading on that subject.

I'm using Karaf 2.2.5.fuse-70-097 and Camel 2.9.0.fuse-70-097 in FuseESB
7.0.2.fuse-097

Here is the blueprint in the service bundle:

blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
  
xmlns:ext=http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0;
   xmlns:blueprint=http://www.osgi.org/xmlns/blueprint/v1.0.0;

service id=vmProperties interface=java.util.Properties
bean class=java.util.Properties
argument
props
prop
key=event.endpointactivemq:myapp.event.queue/prop
prop
key=command.endpointactivemq:myapp.command.queue/prop
/props
/argument
/bean
/service
/blueprint

Here is the blueprint for the camel route bundle:

blueprint xmlns=http://www.osgi.org/xmlns/blueprint/v1.0.0;
  
xmlns:cm=http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0;
  
xmlns:ext=http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0;
   xmlns:amq=http://activemq.apache.org/schema/core;
   xmlns:cml=http://camel.apache.org/schema/blueprint;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint/camel-blueprint-2.9.0.xsd;

cml:camelContext id=test-camel-context 
cml:propertyPlaceholder location=ref:vmProperties /
cml:route
cml:from uri={{event.endpoint}} /
cml:setBody
cml:constantHello Universe/cml:constant
/cml:setBody
cml:log message=## Sending Test Message /
cml:to uri={{command.endpoint}} /
/cml:route

cml:route
cml:from uri={{command.endpoint}} /
cml:log message=## Test Message Received /
/cml:route  
/cml:camelContext
/blueprint


Karaf log includes the following:

2013-02-05 10:40:12,455 | ERROR | l-0.0.0-thread-1 | BlueprintContainerImpl 
 
| 10 - org.apache.aries.blueprint - 0.3.1.fuse-70-097 | Unable to start
blueprint container for bundle a-route.xml
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
intialize bean test-camel-context

Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create
route route23: Route[[From[{{event.endpoint}}]] - [SetBody[consta...
because of Failed to resolve endpoint: {{event.endpoint}} due to: Properties
vmProperties not found in registry
...
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: {{event.endpoint}} due to: Properties vmProperties not
found in registry
...
Caused by: java.io.FileNotFoundException: Properties vmProperties not found
in registry




--
View this message in context: 
http://camel.465427.n5.nabble.com/Reference-OSGI-Blueprint-java-util-Properties-service-in-Blueprint-Camel-property-placeholder-tp5726985.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Reference OSGI Blueprint java.util.Properties service in Blueprint Camel property placeholder

2013-02-05 Thread Willem jiang
 in registry
 ...
 Caused by: java.io.FileNotFoundException: Properties vmProperties not found
 in registry
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Reference-OSGI-Blueprint-java-util-Properties-service-in-Blueprint-Camel-property-placeholder-tp5726985.html
 Sent from the Camel - Users mailing list archive at Nabble.com 
 (http://Nabble.com).