ENGLISH

Vert.x in Action: Asynchronous and Reactive Java

Book information

Publisher
Manning Publications
Year
2020
ISBN
1617295620, 9781617295621
Language
english
Format
PDF
Filesize
12 MB (12842136 bytes)
Pages
336\336
Time added
2021-04-22 23:44:58

Description

Vert.x in Action teaches you how to build production-quality reactive applications in Java. This book covers core Vert.x concepts, as well as the fundamentals of asynchronous and reactive programming. Learn to develop microservices by using Vert.x tools for database communications, persistent messaging, and test app resiliency. The patterns and techniques included here transfer to reactive technologies and frameworks beyond Vert.x. Summary As enterprise applications become larger and more distributed, new architectural approaches like reactive designs, microservices, and event streams are required knowledge. The Vert.x framework provides a mature, rock-solid toolkit for building reactive applications using Java, Kotlin, or Scala. Vert.x in Action teaches you to build responsive, resilient, and scalable JVM applications with Vert.x using well-established reactive design patterns. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the technology Vert.x is a collection of libraries for the Java virtual machine that simplify event-based and asynchronous programming. Vert.x applications handle tedious tasks like asynchronous communication, concurrent work, message and data persistence, plus they’re easy to scale, modify, and maintain. Backed by the Eclipse Foundation and used by Red Hat and others, this toolkit supports code in a variety of languages. About the book Vert.x in Action teaches you how to build production-quality reactive applications in Java. This book covers core Vert.x concepts, as well as the fundamentals of asynchronous and reactive programming. Learn to develop microservices by using Vert.x tools for database communications, persistent messaging, and test app resiliency. The patterns and techniques included here transfer to reactive technologies and frameworks beyond Vert.x. What's inside     Building reactive services     Responding to external service failures     Horizontal scaling     Vert.x toolkit architecture and Vert.x testing     Deploying with Docker and Kubernetes About the reader For intermediate Java web developers. About the author Julien Ponge is a principal software engineer at Red Hat, working on the Eclipse Vert.x project. Table of Contents PART 1 - FUNDAMENTALS OF ASYNCHRONOUS PROGRAMMING WITH VERT.X 1 Vert.x, asynchronous programming, and reactive systems 2 Verticles: The basic processing units of Vert.x 3 Event bus: The backbone of a Vert.x application 4 Asynchronous data and event streams 5 Beyond callbacks 6 Beyond the event bus PART 2 - DEVELOPING REACTIVE SERVICES WITHT VERT.X 7 Designing a reactive application 8 The web stack 9 Messaging and event streaming with Vert.x 10 Persistent state management with databases 11 End-to-end real-time reactive event processing 12 Toward responsiveness with load and chaos testing 13 Final notes: Container-native Vert.x Vert.x in Action brief contents contents foreword preface acknowledgments about this book Who should read this book How this book is organized: A roadmap About the code liveBook discussion forum about the author about the cover illustration Part 1: Fundamentals of asynchronous programming with Vert.x Chapter 1: Vert.x, asynchronous programming, and reactive systems 1.1 Being distributed and networked is the norm 1.2 Not living on an isolated island 1.3 There is no free lunch on the network 1.4 The simplicity of blocking APIs 1.5 Blocking APIs waste resources, increase costs 1.6 Asynchronous programming with non-blocking I/O 1.7 Multiplexing event-driven processing: The case of the event loop 1.8 What is a reactive system? 1.9 What else does reactive mean? 1.10 What is Vert.x? 1.11 Your first Vert.x application 1.11.1 Preparing the project 1.11.2 The VertxEcho class 1.11.3 The role of callbacks 1.11.4 So is this a reactive application? 1.12 What are the alternatives to Vert.x? Summary Chapter 2: Verticles: The basic processing units of Vert.x 2.1 Writing a verticle 2.1.1 Preparing the project 2.1.2 The verticle class 2.1.3 Running and first observations 2.2 More on verticles 2.2.1 Blocking and the event loop 2.2.2 Asynchronous notification of life-cycle events 2.2.3 Deploying verticles 2.2.4 Passing configuration data 2.3 When code needs to block 2.3.1 Worker verticles 2.3.2 The executeBlocking operation 2.4 So what is really in a verticle? 2.4.1 Verticles and their environment 2.4.2 More on contexts 2.4.3 Bridging Vert.x and non-Vert.x threading models Summary Chapter 3: Event bus: The backbone of a Vert.x application 3.1 What is the event bus? 3.1.1 Is the event bus just another message broker? 3.1.2 Point-to-point messaging 3.1.3 Request-reply messaging 3.1.4 Publish/subscribe messaging 3.2 The event bus in an example 3.2.1 Heat sensor verticle 3.2.2 Listener verticle 3.2.3 Sensor data verticle 3.2.4 HTTP server verticle 3.2.5 Bootstrapping the application 3.3 Clustering and the distributed event bus 3.3.1 Clustering in Vert.x 3.3.2 From event bus to distributed event bus Summary Chapter 4: Asynchronous data and event streams 4.1 Unified stream model 4.2 What is back-pressure? 4.3 Making a music-streaming jukebox 4.3.1 Features and usage 4.3.2 HTTP processing: The big picture 4.3.3 Jukebox verticle basics 4.3.4 Incoming HTTP connections 4.3.5 Downloading as efficiently as possible 4.3.6 Reading MP3 files, but not too fast 4.4 Parsing simple streams 4.5 Parsing complex streams 4.6 A quick note on the stream fetch mode Summary Chapter 5: Beyond callbacks 5.1 Composing asynchronous operations: The edge service example 5.1.1 Scenario 5.1.2 Heat sensor verticles 5.1.3 Snapshot service verticle 5.2 Callbacks 5.2.1 Implementation 5.2.2 Running 5.2.3 The “callback hell” is not the problem 5.3 Futures and promises 5.3.1 Futures and promises in Vert.x 5.3.2 Future-based APIs in Vert.x 4 5.3.3 Interoperability with CompletionStage APIs 5.3.4 Collector service with Vert.x futures 5.4 Reactive extensions 5.4.1 RxJava in a nutshell 5.4.2 RxJava and Vert.x 5.4.3 Collector service in RxJava 5.5 Kotlin coroutines 5.5.1 What is a coroutine? 5.5.2 Vert.x and Kotlin coroutines 5.5.3 Edge service with coroutines 5.6 Which model should I use? Summary Chapter 6: Beyond the event bus 6.1 Revisiting heat sensors with a service API 6.2 Return of the RPCs (remote procedure calls) 6.3 Defining a service interface 6.4 Service implementation 6.5 Enabling proxy code generation 6.6 Deploying event-bus services 6.7 Service proxies beyond callbacks 6.8 Testing and Vert.x 6.8.1 Using JUnit 5 with Vert.x 6.8.2 Testing DataVerticle 6.8.3 Running the tests Summary Part 2: Developing reactive services with Vert.x Chapter 7: Designing a reactive application 7.1 What makes an application reactive 7.2 The 10k steps challenge scenario 7.3 One application, many services 7.4 Service specifications 7.4.1 User profile service 7.4.2 Ingestion service 7.4.3 Activity service 7.4.4 Public API 7.4.5 User web application 7.4.6 Event stats service 7.4.7 Congrats service 7.4.8 Dashboard web application 7.5 Running the application Summary Chapter 8: The web stack 8.1 Exposing a public API 8.1.1 Routing HTTP requests 8.1.2 Making HTTP requests 8.2 Access control with JWT tokens 8.2.1 Using JWT tokens 8.2.2 What is in a JWT token? 8.2.3 Handling JWT tokens with Vert.x 8.2.4 Issuing JWT tokens with Vert.x 8.3 Cross-origin resource sharing (CORS) 8.3.1 What is the problem? 8.3.2 Supporting CORS with Vert.x 8.4 A modern web frontend 8.4.1 Vue.js 8.4.2 Vue.js application structure and build integration 8.4.3 Backend integration illustrated 8.4.4 Static content serving with Vert.x 8.5 Writing integration tests Summary Chapter 9: Messaging and event streaming with Vert.x 9.1 Event-driven services beyond HTTP with Vert.x 9.1.1 What Vert.x provides 9.1.2 The middleware and services that we’ll use 9.1.3 What is AMQP (and a message broker)? 9.1.4 What is Kafka? 9.2 Reliably ingesting messages over HTTP and AMQP 9.2.1 Ingesting from AMQP 9.2.2 Translating AMQP messages to Kafka records 9.2.3 Ingesting from HTTP 9.3 Sending congratulation emails 9.3.1 Listening for daily step update events 9.3.2 Sending emails 9.4 Integration tests 9.4.1 Ingestion testing 9.4.2 Congratulation email testing Summary Chapter 10: Persistent state management with databases 10.1 Databases and Vert.x 10.1.1 What the Eclipse Vert.x stack provides 10.1.2 A note on data/object mapping, and why you may not always need it 10.2 User profile service with MongoDB 10.2.1 Data model 10.2.2 User profile API verticle and initialization 10.2.3 Validating user input 10.2.4 Adding users in MongoDB 10.2.5 Authenticating a user 10.2.6 Fetching a user’s data 10.2.7 Updating a user’s data 10.3 Activity service with PostgreSQL 10.3.1 Data model 10.3.2 Opening a connection pool 10.3.3 Life of a device update event 10.3.4 Inserting a new record 10.3.5 Generating a device’s daily activity update 10.3.6 Activity API queries 10.4 Integration tests 10.4.1 Testing the user profile service 10.4.2 Testing the activity service API 10.4.3 Testing the activity service’s event handling Summary Chapter 11: End-to-end real-time reactive event processing 11.1 Advanced stream data processing with Kafka and RxJava 11.1.1 Enriching daily device updates to generate user updates 11.1.2 Computing device-update ingestion throughput using time-window aggregates 11.1.3 Computing per-city trends using aggregation discriminants and time windows 11.2 Real-time reactive web applications 11.2.1 Forwarding Kafka records to the Vert.x event bus 11.2.2 Bridging the event bus and web applications 11.2.3 From Kafka to live web application updates 11.3 Streams and state 11.3.1 A stream of updates 11.3.2 Hydrating the ranking state 11.3.3 Periodically updating rankings from the updates stream Summary Chapter 12: Toward responsiveness with load and chaos testing 12.1 Initial experiments: Is the performance any good? 12.1.1 Some considerations before load testing 12.1.2 Simulating users with Locust 12.1.3 Load testing the API with Hey 12.2 Let’s do some chaos engineering 12.2.1 Test plan 12.2.2 Chaos testing with Pumba 12.2.3 We are not resilient (yet) 12.3 From “scalable” to “scalable and resilient” 12.3.1 Enforcing timeouts 12.3.2 Using a circuit breaker 12.3.3 Resiliency and fallback strategies Summary Chapter 13: Final notes: Container-native Vert.x 13.1 Heat sensors in a cloud 13.1.1 Heat sensor service 13.1.2 Sensor gateway 13.1.3 Heat API 13.1.4 Deploying to a local cluster 13.2 Making the services work in Kubernetes 13.2.1 Building container images 13.2.2 Clustering and Kubernetes 13.2.3 Kubernetes deployment and service resources 13.3 First-class Kubernetes citizens 13.3.1 Health checks 13.3.2 Metrics 13.4 The end of the beginning Summary index Symbols A B C D E F G H I J K L M N O P Q R S T U V W Y Z

Similar books

Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36

Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36

2010 · PDF

THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.

THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.

1858 · PDF

Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.

Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.

2022 · PDF

The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians

The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians

1809 · PDF