Announcement Announcement Module
Collapse
No announcement yet.
QueueChannel without task executor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 09:40 AM.

  • #2
    ... 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.

    Comment


    • #3
      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, 10:55 AM.

      Comment


      • #4
        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.

        Comment


        • #5
          Okay, thanks for your reply, will proceed debugging

          Comment

          Working...
          X