redeploying Fuse services/bundles seems to require a restart
richard.ballard May 1, 2017 8:01 PMHello,
I am new to JBoss Fuse and am evaluating it for my employer. I am running Fuse version 6.3 - e.g.:
JBossFuse:karaf@root> version
2.4.0.redhat-630187
I have a simple case where there is a bundle (known as 'serviceA') at version 5.0 that exports a service (rbtest.servicea.TextTransformer). I have a service consumer (known as 'clientA') that imports a range of the service from 5.0 -> 6.0, e.g.
<dependency>
<groupId>com.rbtest</groupId>
<artifactId>serviceA</artifactId>
<version>[5.0,6)</version>
</dependency>
This all seems to work on initial load of bundles.
My issue is that when I update serviceA from 5.0 to 5.1 (with no changes to the service semantics, just an internal change to the service) and restart clientA I see the following in the log:
2017-05-02 11:41:57,079 | INFO | l Console Thread | BlueprintContainerImpl | 23 - org.apache.aries.blueprint.core - 1.4.5 | Bundle com.rbtest.clientA/5.0.0 is waiting for dependencies [(objectClass=rbtest.servicea.TextTransformer)]
I can see in the headers of serviceA that it is exporting the service in the required range:
JBossFuse:karaf@root> headers 439
serviceA (439)
...
Export-Service =
rbtest.servicea.TextTransformer;transformer.language=english
Export-Package =
rbtest.servicea;version=5.1.0
Import-Package =
org.osgi.service.blueprint;version="[1.0.0,2.0.0)"
and I can see in the headers of clientA that it is importing the required range:
JBossFuse:karaf@root> headers 438
clientA (438)
...
Import-Service =
org.fusesource.example.service.HelloWorldSvc;multiple:=false,
rbtest.servicea.TextTransformer;multiple:=false
Export-Package =
rbtest.clienta;uses:="org.fusesource.example.service,rbtest.servicea";version=5.0.0
Import-Package =
org.fusesource.example.service;version="[1.0,2)",
org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
rbtest.servicea;version="[5.0,6)"
So, it seems that clientA is stuck waiting for the dependency rbtest.servicea.TextTransformer that never comes.
Some workarounds I found are:
- reinstalling the clientA bundle (and restarting it)
- restarting fuse
Both of these work (i.e. no hanging on waiting for dependencies) but obviously these will neither scale well nor work in a production deployment.
Thanks in advance for your help,
Richard