Well, considering the options, maybe having to restart the bundle is a lesser 
evil after all.  
Anyway, thanks Willem and Christian for the quick replies.

BR,

Marcos.


-----Mensaje original-----
De: Christian Schneider [mailto:[email protected]] 
Enviado el: jueves, 20 de enero de 2011 14:38
Para: [email protected]
Asunto: AW: CXF endpoint's address dynamically modified?

We did such tests by using a property in the endpoint address.
For tests we used a property file with the mock endpoint address and for 
production the real one. This worked nicely.
We did not have the requirement to do this  without restart though.

I guess camel resolves these properties on startup so this won´t help you.

Perhaps you could use an osgi service? The client only calls the osgi service. 
For production you start a camel route that listens on the production service 
and for tests the mock service. The easiest way to do this is to create a 
bundle for the service proxy to the prod service and a bundle for the mock 
service. Then you can start and stop these bundles to switch the available osg 
service.

Btw. we used this pattern in all osgi systems. From the client code we never 
used cxf or camel directly. Instead we used only osgi serivices there and wired 
them to the client code using spring osgi or declarative services. This also 
has the advantage that your business code has no dependency on cxf and camel.

Christian


-----Ursprüngliche Nachricht-----
Von: Marcos Díez Fernández [mailto:[email protected]] 
Gesendet: Donnerstag, 20. Januar 2011 14:07
An: [email protected]
Betreff: RE: CXF endpoint's address dynamically modified?

Hi,

I'll explain a little more the use case. In the production environment, the 
camel CXF client has to point to a certain Web Service. For the purpose of 
testing the client, I've created a mock web service that replicates real's 
behavior. I'd like to be able to change from the real to the mock and vice 
versa easily, without having to restart the client bundle. The ideal way of 
achieving this would be by changing an address property in a file and 
configuring OSGi container to call an update method to modify endpoint's 
address whenever this change happens. 

Maybe there's a better way to do this?

Thanks in advance.

BR,

Marcos.



-----Mensaje original-----
De: Christian Schneider [mailto:[email protected]] Enviado el: jueves, 20 
de enero de 2011 13:22
Para: [email protected]
Asunto: Re: CXF endpoint's address dynamically modified?

I guess you can change the endpoints like Willem advised. Could you explain a 
little more what your use case is? So when do you want to change the address 
and what triggers this?

The reason I ask is that like always in Camel and also OSGi there are several 
possible solutions and the right one depends a lot on your use case.

Christian


Am 20.01.2011 12:23, schrieb Marcos Díez Fernández:
> Hi,
>
> I have set up a camel CXF client with Spring in ServiceMix-4.3.0-fuse-03-00 
> based on Karaf OSGi container. Due to my project requirements, and to take 
> advantage of OSGI capabilities,  I'd like to change the CXF endpoint's 
> address dynamically. Until now I can extract the endpoint from the camel 
> context but I'm not able to modify its address:
>
> CxfEndpoint cxfEndpoint = (CxfEndpoint) 
> camelContext.getEndpoint("cxfEsiosMPClient");
>
> I've seen there is a setAddress method for CxfEndpoint in Camel 2.5.0, but 
> currently Servicemix just contains Camel 2.4.0, which doesn't have this 
> setter.
>
> Does this setter solves this issue, and therefore I should wait for a new 
> version of ServiceMix? Or is there any workaround for this?
>
> Any help would be appreciate. Thanks in advance.
>
> BR,
>
> Marcos
>
>

--
----
http://www.liquid-reality.de

Reply via email to