Karena Anda ingin menyimpan seluruh JSON, tidak perlu melakukan deserialize sebagai objek:Saya sarankan Anda cukup mengubah payload yang di-streaming HTTP menjadi java.lang.String
dan masukkan apa adanya di DB.
Ini akan dilakukan seperti itu:
<jdbc:postgresql-data-source name="PostgreSQL_Data_Source"
user="username" password="pwd" url="jdbc:postgresql://localhost:5432/TestDB"
transactionIsolation="UNSPECIFIED" doc:name="PostgreSQL Data Source" />
<jdbc:connector name="PostgreSQL_Connector" dataSource-ref="PostgreSQL_Data_Source"
validateConnections="true" queryTimeout="-1" pollingFrequency="0"
doc:name="Database">
<jdbc:query key="InsertRecord"
value="INSERT INTO "AnotherJSonTable"("StoreJsonObject") VALUES (CAST(#[message.payload] AS json))" />
</jdbc:connector>
<flow name="testRestFlow1" doc:name="testRestFlow1">
<http:inbound-endpoint exchange-pattern="request-response"
address="http://localhost:8082/index.html" doc:name="HTTP" />
<http:rest-service-component httpMethod="GET"
serviceUrl="http://localhost:35798/RestServiceImpl.svc/json/567" />
<object-to-string-transformer />
<jdbc:outbound-endpoint exchange-pattern="one-way"
queryKey="InsertRecord" queryTimeout="-1" connector-ref="PostgreSQL_Connector"
doc:name="Database" />
</flow>