I use spring android in a thread dedicated to execute spring android requests.

I can't achieve to abort a request launched from spring android (a getForObject for instance).

I tried to :

  • reach the underlying input stream to close but it is completely wrapped in springandroid restemplate and can't be accessed from outside
  • interrupt the thread
  • get the request factory of the rest template and call destroy
  • get the connection manager of the factory and call shutdown
  • change the rest template factory's http client
  • change the rest template factory's request factory
  • but I can't abort a request and send a new one quickly. The first one has to reach its timeout.


How could I "kill" a spring android request a get a stable rest template to send a new request ?

Thanks in advance.