org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper Java Examples

The following examples show how to use org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ZuulApplication.java    From spring-cloud-docker-microservice-book-code with Apache License 2.0 5 votes vote down vote up
@Bean
public PatternServiceRouteMapper serviceRouteMapper() {
  // 调用构造函数PatternServiceRouteMapper(String servicePattern, String routePattern)
  // servicePattern指定微服务的正则
  // routePattern指定路由正则
  return new PatternServiceRouteMapper("(?<name>^.+)-(?<version>v.+$)", "${version}/${name}");
}
 
Example #2
Source File: ZuulApplication.java    From spring-cloud-docker-microservice-book-code with Apache License 2.0 5 votes vote down vote up
@Bean
public PatternServiceRouteMapper serviceRouteMapper() {
  // 调用构造函数PatternServiceRouteMapper(String servicePattern, String routePattern)
  // servicePattern指定微服务的正则
  // routePattern指定路由正则
  return new PatternServiceRouteMapper("(?<name>^.+)-(?<version>v.+$)", "${version}/${name}");
}
 
Example #3
Source File: GatewayConfig.java    From DBus with Apache License 2.0 4 votes vote down vote up
@Bean
public PatternServiceRouteMapper serviceRouteMapper() {
    return new PatternServiceRouteMapper("(?<name>^.+)-(?<version>v.+$)", "${version}/${name}");
}
 
Example #4
Source File: ApiGatewayApplication.java    From SpringCloudDemo with MIT License 4 votes vote down vote up
/**
 * 自定义路由映射规则
 */
@Bean
public PatternServiceRouteMapper serviceRouteMapper(){
	return new PatternServiceRouteMapper("(?<name>^.+)-(?<version>v.+$)","${version}/${name}");
}