On Aug 21, 2012, at 3:29 PM, Jim Talbut <[email protected]> wrote:

> On 21/08/2012 19:13, Daniel Kulp wrote:
>> Assuming Karaf style etc dir and file based config:admin, create a file like:
>> etc/org.apache.cxf.http.jetty-8017.cfg
>> 
>> port=8017
>> threadingParameters.minThreads=10
>> threadingParameters.maxThreads=50
> 
> Ooh, I didn't know I could do that!
> Specifically I didn't know Jetty would pick up OSGi config properties and I 
> didn't know I could just create property files with any old sub name.

Well, it's not quite THAT simple….  :-)

This is a feature I added to the CXF Jetty transport (2.6.x) to benefit the 
Talend ESB users around configuring the Jetty stuff. (there is a similar thing 
for the http-conduits BTW).    It's not really looking for files.  It's asking 
the config:admin service for stuff for the "org.apache.cxf.http.jetty" service. 
 It's a factory based service to the file based admin stuff has the filename of 
"org.apache.cxf.http.jetty-SOMETHING.cfg"  where SOMETHING really could be 
anything.   I like to use either the port name (in this case) or the host name 
(like localhost) for the conduit cases.   If you use the config:admin commands 
from the Karaf command line, it would name it something completely different.   
 In any case, the config:admin service will hand us a Properties object of the 
properties in that file.   We then loop through the properties and set the 
various config items.   You can look at the code at:

http://svn.apache.org/repos/asf/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/osgi/HTTPJettyTransportActivator.java

if you want.    You should be able to set the same things via normal 
config:admin commands as well.


> Is there any way to work around the bug from the CXF side?  Is it so bad if 
> the bus is set more than once (before some other event takes place)?

Since these things are static, having any bus (even the "cxf" bus) would be 
fine.   The config should be set up front and used by all the users of that 
since you can only have a single Jetty service per port.

Dan




> 
> Thanks.
> 
> What I've done in the mean time is to revert to having a bus named cxf but 
> with a custom ID, which works.
> 
> Jim
> 

-- 
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Reply via email to