【发布时间】:2015-12-28 20:34:19
【问题描述】:
我有一个有效的 OAuth2RestTemplate 客户端(我使用的是 spring-security-oauth2 2.0.7.RELEASE)。现在我想将它公开/包装为 AsyncRestTemplate 以利用 ListenableFuture 的异步语义。不幸的是,以下简单的方法不起作用:
// instantiate and configure OAuth2RestTemplate - works
OAuth2RestTemplate oAuth2RestTemplate = new OAuth2RestTemplate(...);
// wrap sync restTemplate with AsyncRestTemplate - doesn't work
AsyncRestTemplate asyncRestTemplate = new AsyncRestTemplate(
new HttpComponentsAsyncClientHttpRequestFactory(), oAuth2RestTemplate);
如何为我的 HTTP 服务获取 OAuth2 Rest 客户端作为 AsyncRestTemplate?
【问题讨论】:
标签: spring oauth spring-security resttemplate