content: package com.alibabcloud.mse.demo;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.web.client.RestTemplateBuilder;
  import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
  import org.springframework.cloud.gateway.route.RouteLocator;
  import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
  import org.springframework.context.annotation.Bean;
  import org.springframework.core.convert.ConversionService;
  import org.springframework.core.convert.support.DefaultConversionService;
  import org.springframework.web.client.RestTemplate;
  
  @SpringBootApplication
  @EnableDiscoveryClient
  public class SpringCloudGatewayApplication {
      public static void main(String[] args) {
          SpringApplication.run(SpringCloudGatewayApplication.class, args);
      }
  
      @Bean(name = "restTemplate")
      RestTemplate restTemplate() {
          return new RestTemplateBuilder(rt -> rt.getInterceptors().add((request, body, execution) -> {
              request.getHeaders().add("Connection", "close");
              return execution.execute(request, body);
          })).build();
      }
  
      @Bean
      public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
          return builder.routes()
                  .build();
      }
      @Bean
      public ConversionService conversionService() {
          return new DefaultConversionService();
      }
  }
  