Я использую Tomcat и http:inbound-gateway
в качестве шлюза, а канал с именем request
настроен в качестве канала запроса.Иногда к моему сервису приходит много запросов, которые вызывают Too many open files
Ошибка, которая исходит от ОС.Я пытался сделать request
канал QueChannel
и установить для него пропускную способность, но он не работает.Затем я попытался установить канал request
в качестве канала-получателя опроса и установить опрашивающее устройство с фиксированной задержкой для опроса, которое снова не сработало.Есть ли обычный способ ограничить количество запросов ввода?И как я могу настроить ответ в отклоненных запросах?
<int:channel id="request">
<int:queue capacity="100"/>
</int:channel>
...
<int-http:inbound-gateway id="RESTServiceGateway"
supported-methods="GET"
request-channel="request"
error-channel="errorResolver" />
<int:chain input-channel="request" output-channel="response">
<int:poller fixed-delay="1" max-messages-per-poll=""/>
...
Или
<task:executor id="requestExecutor" pool-size="1-10" queue-capacity="10"/>
<int:channel id="request">
<int:dispatcher task-executor="requestExecutor"/>
</int:channel>
<int-http:inbound-gateway id="RESTServiceGateway"
supported-methods="GET"
request-channel="request"
error-channel="errorResolver" />
<int:chain input-channel="request" output-channel="response">
...