175장. JiBX DataFormat
Camel 버전 2.6에서 사용 가능
JiBX는 JiBX 라이브러리 를 사용하여 Java 개체를 마샬링 및 마샬링 해제하는 데 사용하는 데이터 형식입니다.
// lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue");
// lets turn Object messages into XML then send to MQSeries
from("activemq:My.Queue").
marshal().jibx().
to("mqseries:Another.Queue");
마샬링 프로세스는 런타임 시 메시지 유형을 인식할 수 있습니다. 그러나 XML에서 메시지를 마샬링 해제하는 동안 대상 클래스를 명시적으로 지정해야 합니다.
// lets turn XML into PurchaseOrder message from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). to("activemq:My.Queue");
// lets turn XML into PurchaseOrder message
from("mqseries:Another.Queue").
unmarshal().jibx(PurchaseOrder.class).
to("activemq:My.Queue");
175.1. 옵션 링크 복사링크가 클립보드에 복사되었습니다!
JiBX 데이터 형식은 아래에 나열된 3 가지 옵션을 지원합니다.
이름 | Default | Java Type | 설명 |
---|---|---|---|
unmarshallClass |
| XML에서 Java로 분리할 때 사용할 클래스 이름입니다. | |
bindingName |
| 사용자 정의 바인딩 팩토리 사용 | |
contentTypeHeader |
|
| 데이터 형식이 이를 수행할 수 있는 경우 데이터 형식이 데이터 형식에서 형식을 사용하여 Content-Type 헤더를 설정해야 하는지의 여부입니다. 예를 들어 데이터 형식의 application/xml은 XML로 마샬링하거나 JSon 등에 데이터 형식의 경우 application/json입니다. |