262.11. 속성 구성 요소 사용 예
끝점 URI에서 속성 자리 표시자를 사용하는 경우 속성: 구성 요소를 사용하거나 URI에서 직접 자리 표시자를 정의할 수 있습니다.When using property placeholders in the endpoint URIs you can either use the properties:
component or define the placeholders directly in the URI. 우리는 이전부터 시작하여 두 가지 경우의 예를 보여줍니다.
// properties cool.end=mock:result // route from("direct:start").to("properties:{{cool.end}}");
자리 표시자를 끝점 uri의 일부로 사용할 수도 있습니다.
// properties cool.foo=result // route from("direct:start").to("properties:mock:{{cool.foo}}");
위의 예에서 to 끝점은 mock:result
로 확인됩니다.
다음과 같이 서로 참조를 사용하여 속성을 지정할 수도 있습니다.You can also have properties with refer to each other such as:
// properties cool.foo=result cool.concat=mock:{{cool.foo}} // route from("direct:start").to("properties:mock:{{cool.concat}}");
cool.concat
이 다른 속성을 참조하는 방법을 확인합니다.
properties:
구성 요소는 또한 locations
옵션을 사용하여 지정된 URI의 위치를 재정의하고 제공할 수 있습니다.
from("direct:start").to("properties:bar.end?locations=com/mycompany/bar.properties");