Book Image

Getting Started with Hazelcast

By : Matthew Johns
Book Image

Getting Started with Hazelcast

By: Matthew Johns

Overview of this book

Table of Contents (18 chapters)
Getting Started with Hazelcast
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Going RESTful


An alternative to memcache would be the even more generic RESTful API. Without wanting to go into too much detail, REST is a popular convention of providing HTTP access to data via resources; these are set up to provide path-like access to collections, objects, and properties. Hazelcast additionally provides a simple HTTP service built-in to each of the nodes to enable access to our standard map and queue collections via HTTP.

The structure of the API is pretty simple:

http://127.0.0.1:5701/hazelcast/rest/maps/mapName/key

http://127.0.0.1:5701/hazelcast/rest/queues/queueName

Where mapName or queueName is as configured within our application, we can then use the standard REST convention of using the HTTP method to describe the type of operation we wish to perform.

In the case of maps, we send in all cases the appropriate key as required; but using a POST method to create or update an entry, specifying an appropriate MIME type as needed.

$ curl -v -X POST -H "Content-Type: text...