Spring Rest Template - Queries related to closing

2019-09-01 05:21发布

问题:

I have created class Rest Client and autowired the Spring RestTemplate having scope singleton.

So any Rest Call to server would be using the same RESTClient and I dont create a new Client for each call rest call.

So i am re-using the Rest client object .

1: Do i need to create a new Rest Client for each request ? 2: Do i need to close the httpClient connection after each Rest call ?

标签: spring rest