Skip to content

infinispan-demos/infinispan-pokemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infinispan Pokemon

This demo uses the query and REST capabilities of Infinispan Server to help you battle Pokemons!

Data is ingested as JSON, and internally stored efficiently as Protobuf. Both query and retrieval happens using JSON taking advantage of the mapping between Protobuf and JSON present in Infinispan

Requirements

Running

  • Start Infinispan Server:

    docker run -it --name infinispan-server -p 11222:11222 -e "USER=user" -e "PASS=user" infinispan/server:13.0

  • Prepare data

    python3 prepare-data.py

  • Creating an indexed cache

    curl -u user:user --digest -H "Content-Type: application/json" -d '{"distributed-cache":{"mode":"SYNC","encoding":{"key":{"media-type":"application/x-protostream"},"value":{"media-type":"application/x-protostream"}},"indexing":{"indexed-entities":["Pokemon"]}}}' http://127.0.0.1:11222/rest/v2/caches/pokemon

  • Register the protobuf schema

    curl -u user:user --digest --data-binary @./pokemon.proto http://127.0.0.1:11222/rest/v2/schemas/pokemon.proto

  • Ingest data

    ./ingest-data.sh

Querying

Example queries: