Community
Participate
Working Groups
Build ID: I20090430-2300 Steps To Reproduce: If you look at the minThreads and maxThreads values in HttpConfiguration, you will notice that they are only read in the update method. This is unfortunate, as it requires that ConfigurationAdmin be loaded in order to set the values. It would be far better if these values could be set, like the port numbers, by using a -D option. This would allow people to use the HttpService and control the pool size, without requiring them to bring in ConfigurationAdmin.
Do you mean HttpServerManager? A couple things... 1) The updated method is used when configuring via Config Admin, JettyConfigurator, or via system properties. We just use the same approach of sending in a dictionary to do the configuring. 2) minThreads/maxThreads is not one of the supported configuration parameters so in that case you need to use a JettyCustomizer and make it available in a fragment to allow you to do the er... customization you want.
We're just using the HttpService implementation out of org.eclipse.equinox.http. There is no jetty code in our system at this time. Right now my declarative service just specifies that it needs an HttpService instance. One gets passed in, and I register my servlet. I can use -D options to override the ports this way, but I can't make the thread pool size change. We're on an embedded platform where space is very tight, so I'm not eager to add in config admin just to set these values.
re: org.eclipse.equinox.http Ah... naturally -- forgot what constraints you guys are up against. If you want to work on a patch to configure via properties I think it sounds reasonable and we could definitely look at working with your patch and committing it.
I agree with Simon, if you have a patch we will be glad to work with you to get it into 3.6. Moving to compendium where the http service impls live.
Ok, Before I get going on the patch, can we agree on what the -D options should be named. I'd suggest... org.osgi.service.http.minThreads and org.osgi.service.http.maxThreads
(In reply to comment #5) > Ok, Before I get going on the patch, can we agree on what the -D options should > be named. I'd suggest... > > org.osgi.service.http.minThreads and org.osgi.service.http.maxThreads > Those names look like they are OSGi standardized names which they are not. Since these names apply to the Equinox implementation, they should start with equinox (or whatever the standard equinox property prefix is.)
I came up with those names by following the style of the other properties in the HttpConfiguration class that are already externalized through -D options. protected final static String enviroKeyHttpPort = "org.osgi.service.http.port"; //$NON-NLS-1$ protected final static String enviroKeyHttpsPort = "org.osgi.service.http.port.secure"; //$NON-NLS-1$ protected final static String enviroKeyHttpAddress = "org.eclipse.equinox.http.address"; //$NON-NLS-1$ Are these keys in the OSGi spec? Can someone on the compendium team suggest the proper equinox prefix, if we don't use the osgi prefix?
BJ is correct. Properties beginning with org.osgi.* are osgi spec'ed (org.osgi.service.http.port and org.osgi.service.http.port.secure are documented in the compendium specification). You should use something similar to the http.address option which starts with org.eclipse.equinox: org.eclipse.equinox.http.minThreads org.eclipse.equinox.http.maxThreads
Created attachment 140993 [details] Patch to add -D for thread pool size to HttpConfiguration Here is my first pass at fixing the problem. Please let me know if it needs further work.
Thanks James, I will take a look at the patch and target it for M1.
This missed M1. I will look at this early in M2.
Created attachment 147220 [details] updated patch I had issues applying this patch to HEAD. It appears that this patch is against some other repository. Anyway I manually created a patch against our repository based on the original patch you provided. The current implementation for min threads seems to limit the min threads to 5. If I specify 2 then 5 threads still get created. If I specify 8 then 8 threads get created. Is that acceptable behavior for you?
Sorry, I WILL release this next week after M2. Please open a separate defect if a minimum of 5 threads is not acceptable.
patch released for M3.
Thomas, I am using org.eclipse.equinox.http.jetty. Is there a corresponding org.eclipse.equinox.http.jetty.maxThreads and org.eclipse.equinox.http.jetty.minThreads I don't see it in the api. I also tried setting -Djava.home to a directory and put a jetty.xml file in ${java.home}/etc/ but that didn't seem to work either. Any suggestions? Also, what is the default min/maxthreads for org.eclipse.equinox.http.jetty?
(In reply to John Reysa from comment #15) > Thomas, I am using org.eclipse.equinox.http.jetty. > Is there a corresponding > org.eclipse.equinox.http.jetty.maxThreads and > org.eclipse.equinox.http.jetty.minThreads > I don't see it in the api. > I also tried setting -Djava.home to a directory > and put a jetty.xml file in ${java.home}/etc/ but > that didn't seem to work either. Any suggestions? > Also, what is the default min/maxthreads for > org.eclipse.equinox.http.jetty? Sorry for the unreasonable time it took to answer. This bug was about the small embedded http service implementation Equinox used to maintain. We no longer have this implementation and only maintain the http service that is backed by jetty.