2
votes

In my project I have a thousand of queue, and i want to have one consumer per queue to consume message synchronously.

I have a task executor with thread pool size 20 shared between thousand of message-driven-channel-adapter

When i start my application, i must wait 40 minutes to see all queue listener started. I cant see where is the problem ?

<int-jms:message-driven-channel-adapter
            id="jmsAdapter"
            acknowledge="transacted"
            connection-factory="cachedConnectionFactory"
            destination="destination"
            channel="inboundChannel"
            max-concurrent-consumers="1"
            concurrent-consumers="1"
            auto-startup="false"
            task-executor="taskExecutor"/>

<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="20"/>
        <property name="maxPoolSize" value="20"/>
    </bean>

Thank you

1
How do you start your listeners? You have auto-startup=false so I assume you use a control-bus or programmatic start of the listerns. Depending on how this is implemented it could be the cause for the observed delay.Thomas
auto-startup=true not change observed delaySamir

1 Answers

0
votes

You can't share threads across containers - each consumer needs a dedicated thread. By default, the container thread will block in the JMS client code for 5 seconds waiting for a message.