>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???

OK. I figured out how to do that. I need to use the following in my cxf.xml:
        <bean id="default-wq"
class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
                <constructor-arg index="0">
                        <!-- Max number of elements in the queue -->
                        <value>20000</value>
                </constructor-arg>
                <constructor-arg index="1">
                        <!-- name -->
                        <value>default</value>
                </constructor-arg>
                <property name="name" value="default" />
                <property name="highWaterMark" value="30" />
        </bean>

Using constructor-arg fixes the issue!

The working queue does not reject newly submitted tasks anymore. 

But I run into a different issue now. My client, that tries to invoke 11000
services (actually the same service 11000 in parallel, using asyncInvoke) at
the same time. I observe an extremely high memory consumption. It goes up to
500 or 600 MB, even though I just invoke a simple Echo service. I'm trying
to figure out the reasons for this strange behavior. One I know more, I'll
report it here.



-- 
View this message in context: 
http://old.nabble.com/RejectedExecutionException-when-doing-many-invokeAsync-invocations-tp28266640p28287839.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to