我有一条骆驼路线,它采用 json 的 String 对象,调用一个 bean 来剥离一个 JSONArray 的玩家。
from("direct:players").routeId("player_route")
.bean(BootstrapStaticParser.class,"getPlayersList")
.split(body())
.to("direct:aws");
但是在我打电话后:
.split(body())
什么应该是一个 json 字符串才进入 LinkedHashMap 但我需要维护 json 格式才能将数据插入 AWS DDB。
记录以显示问题
前
Exchange[ExchangePattern: InOnly, BodyType: net.minidev.json.JSONArray, Body: [{"id":1,"photo":"48844.jpg","web_name":"Player1","team_code":3},{"id":2,"photo":"11334.jpg","web_name":"Player2","team_code":3},{"id":3,"photo":"98980.jpg","web_name":"Player3","team_code":3},{"id":4,"photo":"51507.jpg","web_name":"Player4","team_code":3},...]
后
Exchange[ExchangePattern: InOnly, BodyType: java.util.LinkedHashMap, Body: {id=1, photo=48844.jpg, player=Player1, team_code=3}]
任何帮助,将不胜感激。