Creating a Web Chat with SignalR, Web Sockets, Angular and Magic

Web Sockets and asynchronous message transmissions over socket connections is probably one of the most difficult tasks you can possibly do in any web application. Hence, to make it manageable, it needs to be simplified, the same way the gearbox in your car is simple to use, even though it probably involves thousands of moving parts. In this article I will walk you through how to create a live chat client using SignalR, Web Sockets and Magic. If you wish to follow the tutorial though, the first thing you'll have to do is to download Magic.

The Angular frontend

First we'll need a frontend. Use the Angular CLI to create a new Angular project and name it "chat". Open a terminal on your development machine and execute the following command in it.

Digging Into Sockets With Java Flight Recorder

Let's look at one amazing tool for gathering information about what's going on in your JVM — the Java Flight Recorder.
Let's look at one amazing tool for gathering information about what's going on in your JVM. The tool is called the  Java Flight Recorder, and in today's article, I'm going to use it to dig into how Sockets behave in your Java application.

A lot of people use HTTP APIs to communicate between their services (let's have another article about whether it's a good solution or not), and in a majority of cases, it works fine. However, we can get into situations where performance really matters, and especially for libraries writers, JFR can be a very useful tool to see I/O works in their code.

You may also like: Using Java Flight Recorder With OpenJDK 11

This article is not an introduction to Flight Recorder, it's rather more practical. If you want to learn more about this technology, you can start with JEP 328: Flight Recorder.