ThriftDataFormat 인스턴스를 생성하고 다음과 같이 Camel DataFormat marshal 및 unmarshal API에 전달할 수 있습니다.
ThriftDataFormat format = new ThriftDataFormat(new Work());
from("direct:in").marshal(format);
from("direct:back").unmarshal(format).to("mock:reverse");
ThriftDataFormat format = new ThriftDataFormat(new Work());
from("direct:in").marshal(format);
from("direct:back").unmarshal(format).to("mock:reverse");
Copy to ClipboardCopied!Toggle word wrapToggle overflow
또는 DSL thrift()를 사용하여 unmarshal 기본 인스턴스 또는 기본 인스턴스 클래스 이름을 전달합니다.
// You don't need to specify the default instance for the thrift marshaling
from("direct:marshal").marshal().thrift();
from("direct:unmarshalA").unmarshal()
.thrift("org.apache.camel.dataformat.thrift.generated.Work")
.to("mock:reverse");
from("direct:unmarshalB").unmarshal().thrift(new Work()).to("mock:reverse");
// You don't need to specify the default instance for the thrift marshaling
from("direct:marshal").marshal().thrift();
from("direct:unmarshalA").unmarshal()
.thrift("org.apache.camel.dataformat.thrift.generated.Work")
.to("mock:reverse");
from("direct:unmarshalB").unmarshal().thrift(new Work()).to("mock:reverse");
Copy to ClipboardCopied!Toggle word wrapToggle overflow