Alice52 / project

This repository is muti language and tech integration project.
MIT License
0 stars 0 forks source link

[ec] gateway issue #93

Closed Alice52 closed 3 years ago

Alice52 commented 3 years ago
  1. version-info
spring_cloud_version=Hoxton.SR3
ali_spring_cloud_version=2.2.1.RELEASE
spring_boot_version=2.2.5.RELEASE
  1. cors issue: cannot do duplicate
  @Bean
  public CorsWebFilter coreWebFilter() {
    UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();

    CorsConfiguration corsConfiguration = new CorsConfiguration();
    corsConfiguration.setAllowCredentials(true);
    corsConfiguration.addAllowedOrigin("*");
    corsConfiguration.addAllowedMethod("*");
    corsConfiguration.addAllowedHeader("*");

    source.registerCorsConfiguration("/**", corsConfiguration);

    return new CorsWebFilter(source);
  }
  1. lb:xxx: must not contain _
  2. notice: nacos discovery cannot specify group, it will be assigned to service name

    • [x] beat uri
      • http://101.132.45.28:8848/nacos/v1/ns/instance/beat?app=unknown&namespaceId=582f8a8e-70fd-4ccd-b350-13bdfb429d49&port=8060&clusterName=DEFAULT&ip=192.168.1.104&serviceName=EC_GATEWAY@@EC-GATEWAY-SERVICE&encoding=UTF-8
      • serviceName=EC_GATEWAY@@EC-GATEWAY-SERVICE
      • serviceName cannot contain _
    • [x] it may be a bug.
    • [x] it may be caused by nacos can only find services in the same group.
Alice52 commented 3 years ago

conclusion

  1. root cause: nacos can only find service in the same group
  2. solution: config it in the same group or not config[it will be in DEFAULT_GROUP]