I have a simple rest endpoint that is searching for a message in a Kafka topic. Depending on when/if this message is found, this process could take a couple minutes. When I call this endpoint via Swagger I end up receiving a 504 - Server Timeout
back. How can I keep this connection alive so the client doesn't receive a timeout?
Dropwizard will let you configure the idleTimeout (defaults to 30 seconds), see configuration reference
But I must warn you this is a dangerous path with issues like:
If your process needs more time then there are some solutions like: 1. Websockets (notify the client when the operation completed) 2. Long polling (periodically poll the server for completion result)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.