restful apiget不行,扫描可以

restful api get not work,but scan can work

有人知道为什么 restful api 扫描有数据

http://127.0.0.1:8080/ignite?cmd=qryscanexe&pageSize=5&cacheName=contact

结果 { “成功状态”:0, “错误”:空, “sessionToken”:空, “回复”: { “项目”: [ { “钥匙”: { “编号”:703896957108224 }, “价值”: { “mergedId”:空, “优先级”:0, “身份”:[ { “编号”:“7”, “类型”:“身份证”, “创建日期”:1652932875433, “上次更新”:1652932875433 } ], “followerIds”:[], “联系人类型”:“领导者”, “创建日期”:1652932875433, “上次更新”:1652932875433 } } ], “最后”:是的, “查询ID”:2, “字段元数据”:[ { “架构名称”:空, “类型名称”:空, "字段名": "键", “字段类型名称”:空 }, { “架构名称”:空, “类型名称”:空, "字段名": "值", “字段类型名称”:空 } ] } }.

但是获取命令没有结果。

http://127.0.0.1:8080/ignite?cacheName=contact&cmd=get&keyType=ContactKey&key={"id":703896957108224}

结果 { “成功状态”:0, “affinityNodeId”:“ee5e4d0d-5c91-4b9d-b68f-5dfac2f45908”, “错误”:空, “sessionToken”:空, “响应”:空 }

默认情况下 Ignite REST supports Java built-in types for get/put operations. But it should be possible to implement a custom serialization if needed. In general it's much better to use Ignite thin clients,它比 REST 更实用。