このように、ThriftDataFormat インスタンスを作成し、それを Camel DataFormat マーシャリングおよびアンマーシャリング 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
// 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