Results 1 to 5 of 5

Thread: QueueChannel without task executor

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Rus
    Posts
    87

    Default QueueChannel without task executor

    The reference (and debugging) says that if we simply specify:
    Code:
        <si:channel id="errorChannel">
            <si:queue capacity="500"/>
        </si:channel>
    then a blocking Queue is created, but the poller will be working in the same thread as the caller. Now question - is a situation possible when caller puts something into the queue and the thread is not actually polling right after, but can be given away to do some other job? Because I have integration tests that are expecting that polling happens and message is processed further, but in 30-50% of cases this doesn't happen.
    I'm trying to figure out how SI does this putting/polling from the queue in the internals and whether described situation is possible or something else causes problems. It's not clear what thread does between putting and polling..

    Update:
    I debugged it further and it seems that QueueChannel does not even put message into those 30-50% cases into the queue.
    Last edited by ctapobep; Sep 14th, 2012 at 08:40 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    ... poller will be working in the same thread as the caller.
    That's not correct, where did you read that?

    The poller thread comes from a task scheduler and is separate from the caller.

    I suggest you run with DEBUG level logging; be sure to include the thread in the log (%t for log4j) and you'll see exactly what's going on.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    May 2009
    Location
    Rus
    Posts
    87

    Default

    http://static.springsource.org/sprin...ce/htmlsingle/ :
    If no task-executor is provided, the consumer's handler will be invoked in the caller's thread.
    Update:
    Though yes, I took a look at the thread logs and the thread is really taken from the scheduler.
    Last edited by ctapobep; Sep 14th, 2012 at 09:55 AM.

  4. #4
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,036

    Default

    That has nothing to do with a QueueChannel - it's talking about how the poller works to REMOVE messages from the queue. A completely separate thread puts messages into the queue by send()ing to the channel.

    In the case of the poller, the "caller" is the task scheduler thread, if you add a task-executor to the poller, the scheduler thread hands the work over to an executor thread. If there is no task-executor, the message is processed on the task scheduler's thread.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  5. #5
    Join Date
    May 2009
    Location
    Rus
    Posts
    87

    Default

    Okay, thanks for your reply, will proceed debugging

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •