I am creating a rest template to consume REST API secured by OAuth 2.0.
The provider has implemented an expiry for the access token for 5 mins. So Using the rest template, I will be calling the database and sending records via Rest Template.
The records may vary from 10k to 1 million, so I wanted to create a fault proof system. In the process of sending records even if the token expires, I should be sending the records to the server.
What is the best way of achieving this?
Any help or inputs are highly appreciated.