For the example in this tutorial we will be writing a distributed chat room application, where a nearly unlimited number of people could potentially be talking at the same time. The previous statements made by other users in the chat room will be remembered in memory for a certain period of time, after which they will be forgotten. When a user first connects to the server, they will be sent the entire transcript of messages that have not timed out on the server, after which they will be able to participate anonymously in the ongoing conversation. At any point in the conversation, they may quit, by typing the word 'quit'. Implementing these requirements will demonstrate a number of important API methods of the spymemcached client library talking to a Membase server, which is providing the distributed storage capabilities.
Let's get started.
Download tutorial-start.zip and extract it into a directory. Open a command shell, navigate to that directory, and type the following commands
$ mvn assembly:assembly $ java -jar target\membasetutorial-exe.jar Hello, world!
When you see the words 'Hello, world!' you are ready to continue on with the tutorial.