Building a Real-Time Chat Application with Spring Boot, WebSocket, Cassandra, Redis and RabbitMQ

Retired

This book is no longer available for sale.

Building a Real-Time Chat Application with Spring Boot, WebSocket, Cassandra, Redis and RabbitMQ

About the Book

This book is a step-by-step guide on how to build a real-time chat application using Spring Boot, WebSocket, Cassandra, Redis and RabbitMQ. The application code is available on GitHub and you can start cloning the repository and running it on Docker right now: https://github.com/jorgeacetozi/ebook-chat-app-spring-websocket-cassandra-redis-rabbitmq

Although this is a programming book, it also brings many interesting infrastructure discussions and tips about Continuous Delivery, Docker, NoSQL (Cassandra and Redis) and so on. This book also discuss on how to horizontally scale the WebSocket Chat Application using a full STOMP broker like RabbitMQ. I suggest you to download the sample free book and read the NoSQL chapter inside architecture section so that you have an idea.

My objective writing this book is to bring to readers a new experience mixing a lot of development code with infrastructure interesting and didatic discussions. I’m sure that you'll really enjoy it! :)

About the Author

Jorge Acetozi
Jorge Acetozi

Jorge Acetozi is a senior software engineer and technical writer who spends almost his whole day having fun with things such as AWS, Kubernetes, Docker, Terraform, Ansible, Cassandra, Redis, Elasticsearch, Graylog, Sensu, Fluentd, RabbitMQ, Kafka, Java, Python, Spring, and much more! He loves deploying applications in production while thousands of users are online, monitoring the infrastructure, and acting quickly when monitoring tools decide to challenge his heart's health! Check out my newest articles:

Table of Contents

  •  
    • Who am I?
    • Why I Wrote this Book?
    • Who Is this Book For
  • I Usage
    • 1. Pre-Requisites
    • 2. Executing the Project Locally
    • 3. Simulate a Conversation
      • 3.1 Create New Account
      • 3.2 Create a New Chat Room
      • 3.3 Sign In
      • 3.4 Chat Room
      • 3.5 Send Public Messages
      • 3.6 Send Private Messages
      • 3.7 Check that the Conversation is Stored
      • 3.8 Receive Messages even on Connection Failures
    • 4. Setting up the Development Environment
      • 4.1 Apache Maven
      • 4.2 Importing the Project into Eclipse IDE
  • II Architecture
    • 5. Relationship Between Domain and Architecture
    • 6. Introduction to NoSQL
      • 6.1 Modeling in NoSQL
      • 6.2 Cassandra Overview
        • 6.2.1 Cassandra Concepts
      • 6.3 Redis Overview
        • 6.3.1 Redis vs Memcached
        • 6.3.2 Redis Use Cases
    • 7. Spring Framework
      • 7.1 Spring Boot
      • 7.2 Spring Data JPA Repositories
      • 7.3 Spring Data and NoSQL
    • 8. WebSockets
      • 8.1 Polling vs WebSocket
      • 8.2 WebSockets and Browser Compatibility
      • 8.3 Raw WebSockets vs WebSockets over STOMP
    • 9. Spring WebSockets
      • 9.1 Raw WebSockets Configuration
      • 9.2 WebSockets over STOMP Configuration
      • 9.3 Message Flow using a Simple Broker
      • 9.4 Message Flow Using a Full STOMP Broker
    • 10. Single-Node Chat Architecture
    • 11. Multi-Node Chat Architecture
      • 11.1 Using RabbitMQ as a Full External STOMP Broker
    • 12. Horizontally Scaling Stateful Web Applications
      • 12.1 Using Sticky Session Strategy
      • 12.2 Spring Session and WebSockets
  • III Code by Feature
    • 13. Change the Application Language
    • 14. Login
    • 15. New Account
    • 16. New Chat Room
      • 16.1 Secured REST Endpoints with Spring MVC and Spring Security
    • 17. Join Chat Room
      • 17.1 WebSocket Reconnection Strategy
      • 17.2 WebSocket Events
        • 17.2.1 Send Public System Messages over WebSockets
    • 18. Send User Public Messages over WebSockets
    • 19. Send User Private Messages over WebSocket
  • IV Testing the Code
    • 20. Lazy Deployments vs Fast Deployments
    • 21. Continous Delivery
    • 22. Types of Automated Tests
    • 23. Unit Tests
      • 23.1 InstantMessageBuilderTest.java
      • 23.2 DestinationsTest.java
      • 23.3 RedisChatRoomServiceTest.java
    • 24. Integration Tests
      • 24.1 Setting up Dependencies starting Docker Containers from JUnit
      • 24.2 JUnit Suite
      • 24.3 RedisChatRoomServiceTest.java
      • 24.4 ChatRoomControllerTest.java
    • 25. Split Unit Tests from Integration Tests Using Maven Plugins
      • 25.1 Maven Surefire Plugin
      • 25.2 Maven Failsafe Plugin
    • 26. Continuous Integration Server
    • What is next?
  • Appendices
    • Running Containers on Docker
    • Basic Docker Commands
      • The Docker Run Command
        • Running Containers as a Deamon with -d
        • Naming Containers with –name
        • Exposing Ports with -p
        • Environment Variables with -e
        • Volumes with -v
    • Docker Compose
    • Resource Bundle
      • messages.properties
      • messages_pt.properties

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub