Тъй като искате да съхраните целия JSON, няма нужда да го десериализирате като обект:предлагам ви просто да трансформирате HTTP-стриймирания полезен товар в java.lang.String
и го вмъкнете както е в DB.
Това ще стане така:
<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>