Hi Daniel,
Thanks for your explanations!
On Friday 16 April 2010 9:07:55 am Leo Romanoff wrote:
>> I'm trying to invoke 10000 external services using invokeAsync from my WS
>> client.
>> I set my Executor on the Service objects. This executor is a ThreadPool
>> with 3 threads. But it looks like it is ignored completely by the CXF
>> run-time.
>Hmm... That would be a problem. Can you log a bug with a sample test
case?
I'll try to do it once I have reduced my test case to a minimum.
>> After roughly 250 invocations I get the RejectedExecutionException. As
>> far
>> as I understand it is related to the
>> org.apache.cxf.workqueue.AutomaticWorkQueueImpl. I tried to define some
>> params for it in my cxf.xml, e.g.
>> <bean id="default-wq"
>> class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
>> <property name="name" value="default" />
>> <property name="highWaterMark" value="30" />
>> </bean>
>>
>> But this does not help much. The highWaterMark sets the max number of
>> threads to be used by the thread pool. And setting it to the value of
>> 10000
>> is an overkill. It really tries to start all those threads ...
>highWaterMark is the number of threads. What you need is the size of the
>queue. Unfortunately, the underlying ThreadPoolExecutor only allows that
to
>be set at constructor time, not as properties. Thus, you would need to
use
>constructor-args, not properties, to invoke the constructor:
> public AutomaticWorkQueueImpl(int mqs,
> int initialThreads,
> int highWaterMark,
> int lowWaterMark,
> long dequeueTimeout,
> String name) {
OK. But how can I do that? I'm new to CXF and Spring-based configuration.
Can I do it in the config file somehow? Or do I have to write some code to
achieve that? Do I need to create an AutomaticWorkQueueImpl object in my
code? How can I set as a default queue for the CXF JAX-WS???
Thanks,
Leo
> What I probably need to set is the max size of the queue, but I don't know
> how to do it or if it is possible at all.
>
> BTW, the same code works without any problems under Sun's Metro JAX-WS
> implementation.
>
> Am I doing something wrong?
>
>Thanks,
> Leo
--
View this message in context:
http://old.nabble.com/RejectedExecutionException-when-doing-many-invokeAsync-invocations-tp28266640p28270644.html
Sent from the cxf-user mailing list archive at Nabble.com.