Announcement Announcement Module
Collapse
No announcement yet.
About the ExecutorChannel and QueueChannel Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • About the ExecutorChannel and QueueChannel

    Hi,

    I want to know the diff between ExecutorChannel and QueueChannel and which channel I should choose when I use Spring Integration in my project. I mean do you provide some scenarios to explain the functions of these two channels.

    Thanks a lot.

  • #2
    QueueChannel is really a wrapper over the concept of queue. QueueChanel accumulates messages and consumer can come later and retrieve/poll those messages (one at a time or in chunks)
    ExecutorChannel is the same as DirectChannel with one key difference, it delegates to TaskExecutor (might be different thread) for Message dispatch. Just like DirectChannel and unlike QueueChannel it does requires the subscriber to be present or you'll see exception with the following message: "Dispatcher has no subscribers"
    Here is more info:
    http://static.springsource.org/sprin...mplementations

    Comment


    • #3
      thank you for your kindly reply.

      Because the PollingConsumer uses SchedulerTaskExecutor and polling messages from QueueChannel, so I eager to know if this mechanism will impact the performance?

      I think the ExecutorChannel provide a thread pool for subscribers, is it implement reactor pattern? I want to put channels into diff jvm, if I should choose QueueChannel instend of ExecutorChannel?

      Comment


      • #4
        SI Channels are for in-JVM communication. If you have to break JVM boundaries, you can use various remoting adapters (JMS, TCP/UDP, WS, HTTP etc...)
        With regards to the performance question, it is impossible to answer as we don't know your performance requirements, message size, throughput, hardware, etc...

        Comment


        • #5
          Through my testing, I found the executechannel is better than queuechannel for my scenarios, because I want to use SI to integrate some backend Web Services and use http as my transport type, when I use queue channel, I found there has some relationships about the max-message-per-poll and the queue size and the task-executor core size of the polling consumer, and they are very difficult to adjust them. But when I use executechannel, the performance is better.

          BTW, The message size will be 1k, 5k, 10k, 15k, I found big message will impact the performance of SI.

          I also use spring web service to integrate with SI and found there aslo has some performance issues when the program call WebServiceMessage.createWebServiceMessage(Inputstr eam inputstream) method, because this method will call getImplemention().createEvolope(), this method will occupy almost 50% CPU, the way I work around is using soap message string instead of SoapMessage (SWS interface)

          The Spring Integration Message is also a heavy one when it is transformed to SOAPMessage.

          Comment

          Working...
          X