Example from book, working. With Google message protocol (see book)