Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
Bug description Facing frequent issue of garbage collected . Although each call using - vertexApi.close() ERROR i.g.i.ManagedChannelOrphanWrapper - ~~~ Previous channel ManagedChannelImpl{logId=1, target=us-central1-aiplatform.googleapis.com:443} was garbage collected without being shut down! ~~~ Make sure to call shutdown()/shutdownNow() java.lang.RuntimeException: ManagedChannel allocation site Environment Please provide as many details as possible: Spring AI version, Java version, which vector store you use if any, etc Spring AI version - 0.8.1-SNAPSHOT and Java - 17 Steps to reproduce
Minimal Complete Reproducible example Please provide a failing test or a minimal complete verifiable example that reproduces the issue. Bug reports that are reproducible will take priority in resolution over reports that are not reproducible. sample code - VertexAI vertexApi ; String gcpAccessToken = getGCPAccessTokenByServiceAccount(); GoogleCredentials googleCredentials = new GoogleCredentials(new AccessToken( gcpAccessToken, null)); vertexApi = new VertexAI(genAIConfig.getGcpProjectId(), genAIConfig.getGcpLocation(), googleCredentials);
ChatClient chatClient = new VertexAiGeminiChatClient(vertexApi, VertexAiGeminiChatOptions.builder()
.withTemperature((Float) variables.get(Constants.TEMPERATURE_KEY))
.withModel(modelName)
.withMaxOutputTokens(8000)
.withTopP(1F)
.build());
ChatResponse chatResponse = chatClient.call(prompt);;// Error throwing at this line if(vertexApi != null) { vertexApi.close(); } .
Please share sample code that can fix or handle above issue in . Also application handles multiple request per minutes.