You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Lars-Fredrik Smedberg <it...@gmail.com> on 2014/11/03 10:43:39 UTC

Question on calling @Asynchronous EJB methods

Hi

In WebSphere there is a thread pool for serving @Asynchronous EJB method
calls as well as request work queue used when all threads are busy. When
the thread is full the work is placed on the queue and when the queue is
full the policy of BLOCK or FAIL will determine if the thread calling the
method will hang or fail.

Questions

- Does TomEE have similar configuration?

- Is there any way of knowing before calling the @Asynchronous EJB method
if it will wait before beeing processed (or in the WebSphere case hang)?
Combine it with @AccessTimeout perhaps?

Regards
LF

-- 
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.

Re: Question on calling @Asynchronous EJB methods

Posted by Romain Manni-Bucau <rm...@tomitribe.com>.
@AccessTimeout + @Asynchronous is not enough specified IMHO so I
wouldn't rely on it. For openejb case we go through the thread pool
before respecting @AccessTimeout IIRC so it wouldn't work yes.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-11-03 11:04 GMT+01:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> Hi Romain
>
> Thanks, will look into that.
>
> When I read about @AccessTimeout it doesn't seem that I can use it on
> @Asynchronous methods when the thread pool has no free threads... or?
>
> Regards
> LF
>
> On Mon, Nov 3, 2014 at 10:55 AM, Romain Manni-Bucau <
> rmannibucau@tomitribe.com> wrote:
>
>> Hi
>>
>> in application.properties you can configure:
>>
>> - AsynchronousPool.Size (default 5 for recent versions, was 3 before IIRC)
>> - AsynchronousPool.ShutdownWaitDuration: how many time we wait for
>> tasks to be done when undeploying the app
>> - AsynchronousPool.CorePoolSize
>> - AsynchronousPool.MaximumPoolSize
>> - AsynchronousPool.QueueSize
>> - AsynchronousPool.KeepAliveTime
>> - AsynchronousPool.AllowCoreThreadTimeOut
>> - AsynchronousPool.QueueType: SYNCHRONOUS (SynchronousQueue), LINKED
>> (LinkedBlockingQueue), ARRAY (ArrayBlockingQueue),
>> PRIORITY(PriorityBlockingQueue)
>> - AsynchronousPool.RejectedExecutionHandlerClass:
>> RejectedExecutionHandler implementation, default is
>> org.apache.openejb.util.executor.OfferRejectedExecutionHandler ie
>> retry with a timeout of x seconds (30s by default)
>> - AsynchronousPool.OfferTimeout (if RejectedExecutionHandlerClass not set)
>>
>> I guess you want just a custom RejectedExecutionHandlerClass
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-11-03 10:43 GMT+01:00 Lars-Fredrik Smedberg <it...@gmail.com>:
>> > Hi
>> >
>> > In WebSphere there is a thread pool for serving @Asynchronous EJB method
>> > calls as well as request work queue used when all threads are busy. When
>> > the thread is full the work is placed on the queue and when the queue is
>> > full the policy of BLOCK or FAIL will determine if the thread calling the
>> > method will hang or fail.
>> >
>> > Questions
>> >
>> > - Does TomEE have similar configuration?
>> >
>> > - Is there any way of knowing before calling the @Asynchronous EJB method
>> > if it will wait before beeing processed (or in the WebSphere case hang)?
>> > Combine it with @AccessTimeout perhaps?
>> >
>> > Regards
>> > LF
>> >
>> > --
>> > Med vänlig hälsning / Best regards
>> >
>> > Lars-Fredrik Smedberg
>> >
>> > STATEMENT OF CONFIDENTIALITY:
>> > The information contained in this electronic message and any
>> > attachments to this message are intended for the exclusive use of the
>> > address(es) and may contain confidential or privileged information. If
>> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
>> > immediately at itsmeden@gmail.com, and destroy all copies of this
>> > message and any attachments.
>>
>
>
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.

Re: Question on calling @Asynchronous EJB methods

Posted by Lars-Fredrik Smedberg <it...@gmail.com>.
Hi Romain

Thanks, will look into that.

When I read about @AccessTimeout it doesn't seem that I can use it on
@Asynchronous methods when the thread pool has no free threads... or?

Regards
LF

On Mon, Nov 3, 2014 at 10:55 AM, Romain Manni-Bucau <
rmannibucau@tomitribe.com> wrote:

> Hi
>
> in application.properties you can configure:
>
> - AsynchronousPool.Size (default 5 for recent versions, was 3 before IIRC)
> - AsynchronousPool.ShutdownWaitDuration: how many time we wait for
> tasks to be done when undeploying the app
> - AsynchronousPool.CorePoolSize
> - AsynchronousPool.MaximumPoolSize
> - AsynchronousPool.QueueSize
> - AsynchronousPool.KeepAliveTime
> - AsynchronousPool.AllowCoreThreadTimeOut
> - AsynchronousPool.QueueType: SYNCHRONOUS (SynchronousQueue), LINKED
> (LinkedBlockingQueue), ARRAY (ArrayBlockingQueue),
> PRIORITY(PriorityBlockingQueue)
> - AsynchronousPool.RejectedExecutionHandlerClass:
> RejectedExecutionHandler implementation, default is
> org.apache.openejb.util.executor.OfferRejectedExecutionHandler ie
> retry with a timeout of x seconds (30s by default)
> - AsynchronousPool.OfferTimeout (if RejectedExecutionHandlerClass not set)
>
> I guess you want just a custom RejectedExecutionHandlerClass
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-11-03 10:43 GMT+01:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> > Hi
> >
> > In WebSphere there is a thread pool for serving @Asynchronous EJB method
> > calls as well as request work queue used when all threads are busy. When
> > the thread is full the work is placed on the queue and when the queue is
> > full the policy of BLOCK or FAIL will determine if the thread calling the
> > method will hang or fail.
> >
> > Questions
> >
> > - Does TomEE have similar configuration?
> >
> > - Is there any way of knowing before calling the @Asynchronous EJB method
> > if it will wait before beeing processed (or in the WebSphere case hang)?
> > Combine it with @AccessTimeout perhaps?
> >
> > Regards
> > LF
> >
> > --
> > Med vänlig hälsning / Best regards
> >
> > Lars-Fredrik Smedberg
> >
> > STATEMENT OF CONFIDENTIALITY:
> > The information contained in this electronic message and any
> > attachments to this message are intended for the exclusive use of the
> > address(es) and may contain confidential or privileged information. If
> > you are not the intended recipient, please notify Lars-Fredrik Smedberg
> > immediately at itsmeden@gmail.com, and destroy all copies of this
> > message and any attachments.
>



-- 
Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

STATEMENT OF CONFIDENTIALITY:
The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at itsmeden@gmail.com, and destroy all copies of this
message and any attachments.

Re: Question on calling @Asynchronous EJB methods

Posted by Romain Manni-Bucau <rm...@tomitribe.com>.
Hi

in application.properties you can configure:

- AsynchronousPool.Size (default 5 for recent versions, was 3 before IIRC)
- AsynchronousPool.ShutdownWaitDuration: how many time we wait for
tasks to be done when undeploying the app
- AsynchronousPool.CorePoolSize
- AsynchronousPool.MaximumPoolSize
- AsynchronousPool.QueueSize
- AsynchronousPool.KeepAliveTime
- AsynchronousPool.AllowCoreThreadTimeOut
- AsynchronousPool.QueueType: SYNCHRONOUS (SynchronousQueue), LINKED
(LinkedBlockingQueue), ARRAY (ArrayBlockingQueue),
PRIORITY(PriorityBlockingQueue)
- AsynchronousPool.RejectedExecutionHandlerClass:
RejectedExecutionHandler implementation, default is
org.apache.openejb.util.executor.OfferRejectedExecutionHandler ie
retry with a timeout of x seconds (30s by default)
- AsynchronousPool.OfferTimeout (if RejectedExecutionHandlerClass not set)

I guess you want just a custom RejectedExecutionHandlerClass
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-11-03 10:43 GMT+01:00 Lars-Fredrik Smedberg <it...@gmail.com>:
> Hi
>
> In WebSphere there is a thread pool for serving @Asynchronous EJB method
> calls as well as request work queue used when all threads are busy. When
> the thread is full the work is placed on the queue and when the queue is
> full the policy of BLOCK or FAIL will determine if the thread calling the
> method will hang or fail.
>
> Questions
>
> - Does TomEE have similar configuration?
>
> - Is there any way of knowing before calling the @Asynchronous EJB method
> if it will wait before beeing processed (or in the WebSphere case hang)?
> Combine it with @AccessTimeout perhaps?
>
> Regards
> LF
>
> --
> Med vänlig hälsning / Best regards
>
> Lars-Fredrik Smedberg
>
> STATEMENT OF CONFIDENTIALITY:
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> address(es) and may contain confidential or privileged information. If
> you are not the intended recipient, please notify Lars-Fredrik Smedberg
> immediately at itsmeden@gmail.com, and destroy all copies of this
> message and any attachments.