我正在使用駱駝與Spring Boot。在基本上記錄消息正文的服務路由實現期間,我看到一個如下所示的錯誤。駱駝複雜類型到字符串typeconverter錯誤
No converter found capable of converting from type [com.example.Book] to type [java.lang.String]
我的路線是:
from(REST_ENDPOINT_URI)
.log("${headers}")
.log("${body}")
和我在日誌正文行錯誤。
我的問題是預期的行爲?爲什麼駱駝只是調用Book
對象的toString
方法。而且,如果這是預期的行爲,那麼我需要一個字符串轉換器用於每個新的複雜類型?
did you try .log(「$ {body.toString}」)?假設定義了toString()。 –