Scala Reactive Programming

Build fault-tolerant, robust, and distributed applications in Scala
Preview in Mapt

Scala Reactive Programming

Rambabu Posa

1 customer reviews
Build fault-tolerant, robust, and distributed applications in Scala
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Scala Reactive Programming Book Cover
Scala Reactive Programming
$ 35.99
$ 25.20
Scala Design Patterns - Second Edition Book Cover
Scala Design Patterns - Second Edition
$ 35.99
$ 25.20
Buy 2 for $35.00
Save $36.98
Add to Cart

Book Details

ISBN 139781787288645
Paperback499 pages

Book Description

Reactive programming is a scalable, fast way to build applications, and one that helps us write code that is concise, clear, and readable. It can be used for many purposes such as GUIs, robotics, music, and others, and is central to many concurrent systems. This book will be your guide to getting started with Reactive programming in Scala.

You will begin with the fundamental concepts of Reactive programming and gradually move on to working with asynchronous data streams. You will then start building an application using Akka Actors and extend it using the Play framework. You will also learn about reactive stream specifications, event sourcing techniques, and different methods to integrate Akka Streams into the Play Framework. This book will also take you one step forward by showing you the advantages of the Lagom framework while working with reactive microservices. You will also learn to scale applications using multi-node clusters and test, secure, and deploy your microservices to the cloud.

By the end of the book, you will have gained the knowledge to build robust and distributed systems with Scala and Akka.

Table of Contents

Chapter 1: Getting Started with Reactive and Functional Programming
Introduction to Reactive
Functional programming
Reactive Manifesto
The Java 9 Flow API
Implementations of Reactive Streams
How are Reactive Streams born?
Marble diagrams
Summary
Chapter 2: Functional Scala
Introduction to Scala
Principles of Scala FP
Scala anonymous functions
Everything is an expression
Referential transparency
Functions are first-class citizens
Scala tail-recursion
Scala Type class
Scala Collections in action
Scala Functional Design Patterns
Scala Traits in action
Summary
Chapter 3: Asynchronous Programming with Scala
Introduction to Scala AP
The Scala Future API
The Scala Future
The Scala Promise
Scala ExecutionContext
The relationship between Scala Future components
Scala Future API callbacks
Scala Future API combinators
Scala Future.sequence()
The Scala Async Library
The Scala Future API in Play Framework
The Scala Future API in the Akka Toolkit
A Scala Future versus a Java Future
Summary
Chapter 4: Building Reactive Applications with Akka
Introduction to Akka
Actor Model in-depth
Akka ActorSystem
Akka Actors
Actor basic operations
Akka Supervision
What is Akka's Let It Crash model?
Akka Actors communicate example
Akka Actor's lifecycle example
Akka parent-child Actors example
Actor's Path versus Reference
When we execute actorRef.tell (message), what happens internally?
How to configure a dispatcher?
Akka Configuration
Akka SBT Templates
Akka Logging
Business problem
Akka Actor's implementation
Summary
Chapter 5: Adding Reactiveness with RxScala
Introduction to RxScala
Building blocks of RxScala
RxScala Marble diagrams
Summary
Chapter 6: Extending Applications with Play
Introduction to Play Framework
View Templates
Model and Forms
Configuration
Play Framework View Template constructs
Architecture of Play Framework
What is Play Dependency Injection (DI)
Extend HelloWorld Example With DI
Extending HelloWorld example with Scala Futures
Play Form – Data Model
Extending Play/Scala HelloWorld example with Akka Toolkit
Play Fileupload web application
Summary
Chapter 7: Working with Reactive Streams
Introduction to Akka Streams
Other Reactive Streams implementations
Components of Akka Streams
The Akka Streams API
Modules of Akka Streams
Akka Materialization
Backpressure
Akka Streams programming basics
Why do we need ActorSystem and ActorMaterializer?
Akka Streams HelloWorld example
Extending the Akka Streams HelloWorld example with the Flow component
Akka Streams GraphDSL
An Akka Streams GraphDSL example
Akka Persistence
The CQRS pattern
How to develop Akka Persistence Actors
Akka Persistence MongoDB Weather example
Summary
Chapter 8: Integrating Akka Streams to Play Application
Akka Streams
Developing Akka Dynamic Streams
Integrating Akka Streams into Play
Akka Persistence Query
Summary
Chapter 9: Reactive Microservices with Lagom
Introduction to Lagom Framework
Drawbacks of monolith architecture
Benefits of microservice architecture
Principles of microservices
Lagom Reactive Platform architecture
Modules of Lagom Framework
Kafka with ZooKeeper
Lagom project structure
Lagom System API
Lagom System – implementation
Lagom System – frontend
Lagom Hello Reactive System
Lagom Hello Reactive System microservices
Understanding the Hello Service API code
Understanding HelloService implementation code
Developing Lagom WF Reactive System
Summary
Chapter 10: Testing Reactive Microservices
Introduction to TDD
Unit testing frameworks
Unit testing Play Framework components
Unit testing Lagom services
Summary
Chapter 11: Managing Microservices in ConductR
Introduction to Lightbend's ConductR
Installing Lightbend ConductR
Preparing WF Reactive System for ConductR
Deploying the WF Reactive System on ConductR
Starting ConductR Sandbox with a single node
Observing the WF Reactive System bundles
Running and testing WF Reactive System bundles
Useful ConductR commands
Summary
Chapter 12: Reactive Design Patterns and Best Practices
Understanding Design Patterns
The Circuit Breaker pattern
The Sharding Pattern
The Event Sourcing pattern
The Event Streaming Pattern
The Active-Passive Replication Pattern
The Resource Management Design Patterns
Message Flow Patterns
The Request-Response Design Pattern
Understanding the Reactive Design Pattern
Ask Reactive Design Pattern
The Throttling Pattern
The Pull pattern
Reactive System's best practices and tools
Summary
Chapter 13: Scala Plugin for IntelliJ IDEA
Understanding Scala Plugin
How to set up Scala Plugin for IntelliJ IDE
Summary
Chapter 14: Installing Robomongo
What is Robomongo?
Summary

What You Will Learn

  • Understand the fundamental principles of Reactive and Functional programming
  • Develop applications utilizing features of the Akka framework
  • Explore techniques to integrate Scala, Akka, and Play together
  • Learn about Reactive Streams with real-time use cases
  • Develop Reactive Web Applications with Play, Scala, Akka, and Akka Streams
  • Develop and deploy Reactive microservices using the Lagom framework and ConductR

Authors

Table of Contents

Chapter 1: Getting Started with Reactive and Functional Programming
Introduction to Reactive
Functional programming
Reactive Manifesto
The Java 9 Flow API
Implementations of Reactive Streams
How are Reactive Streams born?
Marble diagrams
Summary
Chapter 2: Functional Scala
Introduction to Scala
Principles of Scala FP
Scala anonymous functions
Everything is an expression
Referential transparency
Functions are first-class citizens
Scala tail-recursion
Scala Type class
Scala Collections in action
Scala Functional Design Patterns
Scala Traits in action
Summary
Chapter 3: Asynchronous Programming with Scala
Introduction to Scala AP
The Scala Future API
The Scala Future
The Scala Promise
Scala ExecutionContext
The relationship between Scala Future components
Scala Future API callbacks
Scala Future API combinators
Scala Future.sequence()
The Scala Async Library
The Scala Future API in Play Framework
The Scala Future API in the Akka Toolkit
A Scala Future versus a Java Future
Summary
Chapter 4: Building Reactive Applications with Akka
Introduction to Akka
Actor Model in-depth
Akka ActorSystem
Akka Actors
Actor basic operations
Akka Supervision
What is Akka's Let It Crash model?
Akka Actors communicate example
Akka Actor's lifecycle example
Akka parent-child Actors example
Actor's Path versus Reference
When we execute actorRef.tell (message), what happens internally?
How to configure a dispatcher?
Akka Configuration
Akka SBT Templates
Akka Logging
Business problem
Akka Actor's implementation
Summary
Chapter 5: Adding Reactiveness with RxScala
Introduction to RxScala
Building blocks of RxScala
RxScala Marble diagrams
Summary
Chapter 6: Extending Applications with Play
Introduction to Play Framework
View Templates
Model and Forms
Configuration
Play Framework View Template constructs
Architecture of Play Framework
What is Play Dependency Injection (DI)
Extend HelloWorld Example With DI
Extending HelloWorld example with Scala Futures
Play Form – Data Model
Extending Play/Scala HelloWorld example with Akka Toolkit
Play Fileupload web application
Summary
Chapter 7: Working with Reactive Streams
Introduction to Akka Streams
Other Reactive Streams implementations
Components of Akka Streams
The Akka Streams API
Modules of Akka Streams
Akka Materialization
Backpressure
Akka Streams programming basics
Why do we need ActorSystem and ActorMaterializer?
Akka Streams HelloWorld example
Extending the Akka Streams HelloWorld example with the Flow component
Akka Streams GraphDSL
An Akka Streams GraphDSL example
Akka Persistence
The CQRS pattern
How to develop Akka Persistence Actors
Akka Persistence MongoDB Weather example
Summary
Chapter 8: Integrating Akka Streams to Play Application
Akka Streams
Developing Akka Dynamic Streams
Integrating Akka Streams into Play
Akka Persistence Query
Summary
Chapter 9: Reactive Microservices with Lagom
Introduction to Lagom Framework
Drawbacks of monolith architecture
Benefits of microservice architecture
Principles of microservices
Lagom Reactive Platform architecture
Modules of Lagom Framework
Kafka with ZooKeeper
Lagom project structure
Lagom System API
Lagom System – implementation
Lagom System – frontend
Lagom Hello Reactive System
Lagom Hello Reactive System microservices
Understanding the Hello Service API code
Understanding HelloService implementation code
Developing Lagom WF Reactive System
Summary
Chapter 10: Testing Reactive Microservices
Introduction to TDD
Unit testing frameworks
Unit testing Play Framework components
Unit testing Lagom services
Summary
Chapter 11: Managing Microservices in ConductR
Introduction to Lightbend's ConductR
Installing Lightbend ConductR
Preparing WF Reactive System for ConductR
Deploying the WF Reactive System on ConductR
Starting ConductR Sandbox with a single node
Observing the WF Reactive System bundles
Running and testing WF Reactive System bundles
Useful ConductR commands
Summary
Chapter 12: Reactive Design Patterns and Best Practices
Understanding Design Patterns
The Circuit Breaker pattern
The Sharding Pattern
The Event Sourcing pattern
The Event Streaming Pattern
The Active-Passive Replication Pattern
The Resource Management Design Patterns
Message Flow Patterns
The Request-Response Design Pattern
Understanding the Reactive Design Pattern
Ask Reactive Design Pattern
The Throttling Pattern
The Pull pattern
Reactive System's best practices and tools
Summary
Chapter 13: Scala Plugin for IntelliJ IDEA
Understanding Scala Plugin
How to set up Scala Plugin for IntelliJ IDE
Summary
Chapter 14: Installing Robomongo
What is Robomongo?
Summary

Book Details

ISBN 139781787288645
Paperback499 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Scala Design Patterns - Second Edition Book Cover
Scala Design Patterns - Second Edition
$ 35.99
$ 25.20
Java: Data Science Made Easy Book Cover
Java: Data Science Made Easy
$ 67.99
$ 47.60
Kotlin Programming By Example Book Cover
Kotlin Programming By Example
$ 39.99
$ 28.00
Learning Scala Programming Book Cover
Learning Scala Programming
$ 35.99
$ 25.20
Learning Scala Programming Book Cover
Learning Scala Programming
$ 35.99
$ 25.20
Microservice Patterns and Best Practices Book Cover
Microservice Patterns and Best Practices
$ 35.99
$ 25.20