Closed randyhbh closed 1 year ago
Please @mp911de could you give me some guidance here on how to achieve this 🙏
Hey @randyhbh , have you been able to collect tcpdump trace of this event ? We are also experiencing random timeout while renewing token / authenticating with the vault. We didn't catch the event on the network level yet and expect to do so to share our findings...
Hi @spectateur, unfortunately not, I was checking our monitoring that we have in Vault and I could not spot anything of the like.
That is why I was looking into increasing the timeout or retrying on this issue.
Did you find a solution for this @spectateur?
This is a duplicate of #659
Hi, @mp911de thanks for linking the previous issue, indeed is duplicated, but I could not find in the docs a way to provide to spring cloud vault with my own Apache HTTP Client config, how can I achieve that? Could you point me in the right direction?
You can fully customize the client, through depending on the level of the customization your mileage may vary. The simple-most option is to set the timeout via ClientOptions
.
A more elaborate variant could look like the following code:
HttpClientBuilder builder = HttpClientBuilder.create();
// customize builder
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(builder.build());
RestTemplateBuilder templateBuilder = RestTemplateBuilder.builder()
.requestFactory(requestFactory)
.endpoint(VaultEndpoint.create("vault.com", 8200));
SessionManager sessionManager = // setup authentication
VaultTemplate template = new VaultTemplate(templateBuilder, sessionManager);
@randyhbh I created an issue on Apache Jira https://issues.apache.org/jira/browse/HTTPCLIENT-2235
Describe the bug I have a Spring Boot + Kotlin microservice that gets the AWS credentials to connect to DynamoDB from Vault.
But randomly the Vault implementation is throwing a SocketTimeoutException while renewing the session token, see the stack trace
In the documentation, how I can provide my own
RestTemplate
configuration increasing the timeout and retrying is unclear.Is there a way I can provide my own
RestTemplate
configuration to Vault?I did the question on StackOverflow but without an answer there, so I decided to open one here to try to get help.