Skip to main content

Netty Cookbook - free ebook for Java Developer


Introduction


Netty.io is a popular open source library that greatly simplifies the development of network applications on top of the JVM.  It abstracts the burden to deal with tedious low level details and allows you to concentrate on your business logic instead.  It is used by high profile companies like Red Hat, Twitter or Facebook and designed from the ground up to handle high throughput at low latency, even with thousands of connections at the same time.

In this book, you are going to build both client and server using netty best practices, which are communicating with each other in a completely asynchronous fashion.  We are going to explore the netty pipeline, how you can reuse existing protocol handlers and how to write your own.
Source code for book https://github.com/trieu/netty-cookbook

Table of Contents
Chapter 1: Communicating in Asynchronous World with Netty (15 pages)
Introduction
Recipe 1.1 Building an asynchronous TCP server and client
Recipe 1.2 Sending hello message to server when connection is ready
Recipe 1.3 Receiving message asynchronously
Recipe 1.4 Get notification from Netty I/O operations
Recipe 1.5 Get notification from ChannelHandler states
Chapter 2: Solving common network programming problems (30 pages)
Recipe 2.1 Getting the local SocketAddress and the remote SocketAddress
Recipe 2.2 Sending and receiving data in Stream-based TCP/IP Transport
Recipe 2.3 Sending data in POJO way with Custom Codec
Recipe 2.4 Listening multiple sockets in one Netty instance
Recipe 2.5 Counting Server Bandwidth in ChannelHandler
Recipe 2.6 Checking Heartbeat Server using UDP
Recipe 2.7 Using Stream Control Transmission Protocol (SCTP) codec
Recipe 2.8 Building simple FTP server
Recipe 2.9 Building server RPC (Remote Procedure Call) with Apache Avro
Chapter 3: Netty for the Web (20 pages)
Introduction
Recipe 3.1 Routing HTTP request to business logic
Recipe 3.2 Integrating Netty with Spring MVC
Recipe 3.3 Serving static content
Recipe 3.4 Cross-Domain Ajax Requests with CorsHandler
Recipe 3.5 Enabling SPDY protocol for faster web
Chapter 4: Going Real Time Web (10 pages)
Introduction about real-time web
Recipe 4.1 Using WebSocket for streaming messages from Twitter
Recipe 4.2 Simple chat application with Netty STOMP Codec
Recipe 4.3 Displaying online users with Redis and netty-socketio
Recipe 4.4 RxNetty for filtering and pushing data in real-time
Chapter 5: Asynchronous networking on mobile (10 pages)
Introduction
Recipe 5.1 Implementing lightweight network protocol for mobile app
Recipe 5.2 Using Netty on Android OS
Recipe 5.3 Asynchronous HTTP Client for Android app
Recipe 5.4 Implementing location-based app with netty-socketio and Lucene Spatial
Chapter 6: Implementing Security, Encryption, and Authentication (10 pages)
Introduction
Recipe 6.1 Implementing HTTP Authentication Client and Server
Recipe 6.2 Implementing IP Filtering to protect your server
Recipe 6.3 Using SelfSignedCertificate to secure networking
Recipe 6.4 Managing distributed session with Memcached Binary protocol
Recipe 6.5 Setting up an HTTPS web server
Chapter 7: High performance Web with HTTP/2 (10 pages)
Introduction about HTTP/2
Recipe 7.1 Using codec-http2 to improve the speed of Web
Recipe 7.2 Enabling multiple streams in single connection
Recipe 7.3 Setting priority in requests
Recipe 7.4 Compressing data response
Recipe 7.5 Enabling server push
Recipe 7.6 Building better static file server for high concurrency
Chapter 8: Connecting Netty to Big Data Ecosystem (15 pages)
Introduction
Recipe 8.1 Building scalable log aggregation server with Netty and Apache Kafka
Recipe 8.2 Distributed HTTP event processing with Akka Actor
Recipe 8.3 Stream Data Processing with Netty and Java 8 Stream API
Recipe 8.4 Monitoring Social Data with Netty HTTP Client and Redis Queue
Recipe 8.5 Making real-time dashboard with Websocket and nvd3.js

Comments

Popular posts from this blog

Vì sao chúng ta cần ứng dụng Dataism cho đời sống

Dataism là một triết lý cho rằng dữ liệu là nền tảng của thực tại.  Theo triết lý này, dữ liệu là thứ tạo ra mọi thứ, từ các sự kiện trong thế giới thực đến suy nghĩ và cảm xúc của con người. Trong bối cảnh cuộc cách mạng công nghiệp 4.0 và sự phát triển mạnh mẽ của công nghệ thông tin. Tên gọi "Dataism" được đặt ra để mô tả một quan điểm cho rằng dữ liệu, đặc biệt là dữ liệu số và thông tin, chính là một nguyên tắc lớn trong tự nhiên và xã hội. Nguyên gốc của Dataism không thể được liên kết chặt chẽ với một cá nhân hay tổ chức cụ thể, nhưng một số tác giả và nhà nghiên cứu nhất định đã đóng góp vào việc phát triển và mô tả triết lý này. Một số tác giả nổi tiếng trong lĩnh vực này bao gồm: Yuval Noah Harari: Tác giả của cuốn sách nổi tiếng "Sapiens: Lược sử loài người" và "Homo Deus: Lược sử tương lai", Harari đã đề cập đến khái niệm Dataism trong việc mô tả sự tiến hóa của con người và xã hội.  https://dataethics.eu/humanism-dataism-future-scenario/ Wiki

Các lý thuyết tâm lý học cổ điển về động lực sống của con người

Hôm nay, mình viết 1 bài post tóm tắt theo kiến thức cơ bản về tâm lý học, theo những gì mình đã đọc + kinh nghiệm sống của cá nhân mình.  sự thật thú vị là Sigmund Freud là thầy của Carl Jung và Adler. Điểm chung:  cả 3 Bác đều tập trung nghiên cứu về các nguyên lý cơ bản mà tâm trí, ý thức của con người hoạt động.  Bản chất là các dữ liệu trong bộ não, ở trạng thái vô thức ảnh hưởng trực tiếp đến cách con người nhận thức về thế giới xung quanh họ, bao gồm cả đạo đức, cách suy nghĩ, cảm xúc và ý chí.  Một người không thể hành động mà không có 1 động lực tác động trong suy nghĩ của họ, nó phải có nguyên nhân. Hầu hết các nguyên nhân nằm trong mode "vô thức", bạn rất ít khi tự nhận ra chúng  Điểm khác biệt và đặc trưng: 1) #SidmundFreud  mô hình tâm lý của Freud tập trung vào  1.1 cõi vô thức con người,   1.2 tình dục và động lực sinh sản là năng lượng chính trong cõi vô thức 1.3 các chấn thương tâm lý nhưng bị ý thức kiềm chế lâu ngày 1.4 các ham muốn (như ham muốn tình dục)