我正在使用AmazonSQS。我正在使用线程从那里读取内容,过了一会儿,我收到了连接池错误
这是我的线程逻辑
ReceiveMessageRequest request = new ReceiveMessageRequest(#url);
request.setMaxNumberOfMessages(#getMaxMessagesPolled);
request.setWaitTimeSeconds(5);
while (true) {
List<Message> messages = new ArrayList<>();
try {
messages = awsService.getMessages(parameters, request);
} catch (Exception clientException) {
continue;
}
for (Message message : messages) {
//process
awsService.removeMessage(parameters, message);
} catch (Exception e) {
continue;
}
}
}
错误:
com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool
我知道默认的连接池大小是50。我没有> 50个线程。
谢谢