You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2019/01/22 09:42:00 UTC
[jira] [Resolved] (SCB-1122) Specify the name of RestTemplate in
the configuration
[ https://issues.apache.org/jira/browse/SCB-1122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang resolved SCB-1122.
-------------------------------
Resolution: Fixed
Applied the patch into master branch.
> Specify the name of RestTemplate in the configuration
> -----------------------------------------------------
>
> Key: SCB-1122
> URL: https://issues.apache.org/jira/browse/SCB-1122
> Project: Apache ServiceComb
> Issue Type: Improvement
> Components: Saga
> Reporter: Willem Jiang
> Assignee: Lei Zhang
> Priority: Major
> Fix For: pack-0.4.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> It's could help us resolve the restemplate conflict issue by specify the name of rest template.
> {code}
> @Configuration
> public class RestTemplateConfig {
> @Autowired(required = false)
> OmegaContext context;
> @Bean(name = "omegaRestTemplate")
> public RestTemplate omegaRestTemplate() {
> RestTemplate template = new RestTemplate();
> List<ClientHttpRequestInterceptor> interceptors = template.getInterceptors();
> interceptors.add(new TransactionClientHttpRequestInterceptor(context));
> template.setInterceptors(interceptors);
> return template;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)