372.4. Spring 또는 Blueprint DSL의 기본 사용량
< dataFormats > 블록 내에서 고유한 ID를 사용하여 xmljson 요소를 구성하기만 하면 됩니다.
<dataFormats>
<xmljson id="xmljson"/>
<xmljson id="xmljsonWithOptions" forceTopLevelObject="true" trimSpaces="true" rootName="newRoot" skipNamespaces="true"
removeNamespacePrefixes="true" expandableProperties="d e"/>
</dataFormats>
그런 다음 간단히 < marshal /> 및 <unmarshal /> DSLs 내의 데이터 형식 오브젝트를 참조합니다.
<route>
<from uri="direct:marshal"/>
<marshal ref="xmljson"/>
<to uri="mock:json" />
</route>
<route>
<from uri="direct:unmarshalWithOptions"/>
<unmarshal ref="xmljsonWithOptions"/>
<to uri="mock:xmlWithOptions"/>
</route>이 구성 요소에 대한 XML DSL 자동 완성 활성화는 쉽습니다. Spring 또는 Blueprint DSL을 사용하는지 여부에 따라 적절한 스키마 위치 를 참조하십시오. 이 데이터 형식은 Camel 2.10 이후 버전에서 사용할 수 있으므로 해당 버전 이후의 스키마만 사용할 수 있으므로 이러한 새로운 XML 요소와 속성이 포함됩니다.
블루프린트의 구문은 Spring DSL의 구문과 동일합니다. 올바른 네임스페이스 및 스키마Location이 사용 중인지 확인합니다.