是否有更具编程性的方式,相当于以下配置:
property("jersey.config.<application.path>", api);
,设置Jersey应用程序的应用程序路径?我想让它可配置,也许可以使用类似的东西:
@ConfigurationProperties(prefix = "jersey")
public class MyResourceConfig extends ResourceConfig {
@Setter @Getter protected String api;
使用addtitinal:
@Component
public class MyRoutes extends SpringRouteBuilder {
public void configure() throws Exception {
from("cxf:bean:serviceV1")
.to("direct:v1");
from("cxf:bean:serviceV2")
.to("direct:v2");
from("cxf:bean:serviceCommon")
.choice()
.when(header("version").isEqualTo("v1"))
.to("direct:v1")
.otherwise()
.to("direct:v2")
.end();
from("direct:v1")
.beanRef("paymentservicev1", "buy");
from("direct:v1")
.beanRef("paymentservicev2", "buy");
}
}
答案 0 :(得分:4)
您可以在spring.jersey.application-path
。
application.properties
个配置
答案 1 :(得分:0)
spring.jersey.application-path = api或您的主要API路径。这将迫使球衣走向那条道路只从/ **