Search code examples
ignite

restful api get not work,but scan can work


anybody know why restful api scan has data

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

result { "successStatus": 0, "error": null, "sessionToken": null, "response": { "items": [ { "key": { "id": 703896957108224 }, "value": { "mergedId": null, "priority": 0, "identities": [ { "id": "7", "type": "idCard", "dateCreated": 1652932875433, "lastUpdated": 1652932875433 } ], "followerIds": [], "contactType": "LEADER", "dateCreated": 1652932875433, "lastUpdated": 1652932875433 } } ], "last": true, "queryId": 2, "fieldsMetadata": [ { "schemaName": null, "typeName": null, "fieldName": "key", "fieldTypeName": null }, { "schemaName": null, "typeName": null, "fieldName": "value", "fieldTypeName": null } ] } }.

but get command no result.

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

result { "successStatus": 0, "affinityNodeId": "ee5e4d0d-5c91-4b9d-b68f-5dfac2f45908", "error": null, "sessionToken": null, "response": null }


Solution

  • By default 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, it's more functional than REST.