
This lesson provides a comprehensive overview of messaging systems, emphasizing their role in facilitating "application-to-application" communication within organizations. Through a practical example involving human resource, marketing, and login systems, the lesson highlights the challenges of traditional scheduling methods and the delays they introduce. It then introduces messaging systems like RabbitMQ as a solution, explaining their centralized message queue structure and how they enable almost real-time communication between systems. The lesson explores the benefits of messaging systems, such as streamlined integration points and improved reliability, and concludes with practical insights into their implementation and diverse real-world use cases, showcasing their ability to handle complex data communication scenarios efficiently.
In this lesson, we will learn about RabbitMQ, an open-source messaging system. While tackling unfamiliar terms like "REST API," we'll emphasize the need for a solid programming foundation. The tutorial covers RabbitMQ's fee-free basic usage, commercial support options, real-time data queuing, reliability, and high-availability deployment. Learners will also explore cloud utilization and discover advantageous features like a free web interface, user access control, and support for various programming languages. The lesson concludes by highlighting RabbitMQ's superiority in the messaging system landscape, making it a valuable online learning topic.
In this lesson, we will learn about the Java programming language, a stalwart in the programming world for over two decades. The tutorial covers Java's platform versatility, from running on Windows, Mac, and Linux to being utilized in Android applications. It distinguishes between Oracle's licensed production use and various free open-source implementations. The lesson emphasizes the importance of frameworks for efficient Java programming, focusing on the Spring framework, particularly Spring Boot, to streamline code and enhance productivity. The completeness of the Spring framework, covering aspects like web development, REST API, microservices, and databases, is explored. The historical evolution of Spring, its support for modern architectures like microservices and reactive stacks, and integration with messaging systems like Kafka and RabbitMQ are highlighted. The lesson also introduces tools such as Eclipse and Gradle for development and dependency management, emphasizing their importance in the Java ecosystem. Participants will learn to use Spring Tools Suite and Gradle to develop Spring applications comfortably.
In this lesson, we will learn to download and install the necessary tools for the course, particularly focusing on Windows. The installation process includes RabbitMQ, which requires the Erlang programming language, and we'll explore the option of using Chocolatey, a Windows package manager, for the RabbitMQ installation. Additionally, we'll install Java, specifically the distribution from Amazon, and the Eclipse Development Environment to facilitate Java programming.
In this lesson, we will learn about different versions of Java implementation, focusing on the open-source Amazon Corretto. The course requires a minimum of Java version 17. The tutorial guides us through downloading and extracting the Java installer, setting up the JAVA_HOME environment variable, adding Java to the PATH variable, and verifying the installation using the command prompt with "java -version."
In this lesson, we will learn about RabbitMQ as a "unique delivery office" where producers (Person A) publish messages and store them in queues, and consumers (Person X) subscribe to specific queues to receive and process messages. The terminology includes producers, queues, exchanges, and consumers, with concepts like subscribing, consuming, and message durability. The lesson covers message routing through exchanges using routing keys, different types of exchanges, and the binding process. Additionally, it explains message durability in RabbitMQ, emphasizing the need for durable queues and persistent messages to ensure data integrity during server restarts or failures.
In this lesson, we will learn about the advantages of using Spring Boot for Java development. Spring Boot simplifies the coding process by handling most configurations, reducing the need for extensive XML or annotation configurations. The course covers dependency management using Gradle, with Spring Initializr aiding project generation. Two Spring Boot projects, one for producers and one for consumers, are created using RabbitMQ. The tutorial guides the user through the Spring Initializr setup, Java version selection, and project download. Additionally, it demonstrates importing and configuring projects in Eclipse, emphasizing the use of application.yml for customizable configurations, such as RabbitMQ connection settings and log patterns.
This lesson will teach us about different types of RabbitMQ queues, focusing on Classic Queues and Quorum Queues. Classic Queues, the default, provide good performance but limited fault tolerance, making them suitable for simple environments. On the other hand, Quorum Queues addresses the limitations of Classic Queues, offering stronger guarantees for durability and high availability. They replicate data across multiple RabbitMQ servers, preventing data loss even in the face of node failures. Quorum Queues are recommended for production environments, especially when data integrity is critical. Additionally, RabbitMQ Stream, a specialized type, will be covered in detail later in the course due to its different behavior and coding approach compared to queues.
In this lesson, we will learn about building a Hello World application for RabbitMQ using Java and Spring Boot. The instructor demonstrates the creation of a producer and a consumer, emphasizing the key steps, such as queue setup, producer implementation, and consumer configuration. The lesson highlights the utilization of RabbitMQ management and the verification of message transmission between the producer and consumer. Additionally, it concludes with essential clean-up steps for the next lesson.
This lesson proves that consumers actively monitor queues, processing incoming messages in real time. We create a new queue, "course.fixedrate," and implement a Java producer and consumer using Spring Boot. The producer sends messages with an incremental number to RabbitMQ every 500 milliseconds, showcasing scheduling capabilities. The consumer, distinct from the previous one, effectively consumes and processes messages immediately upon their arrival in the RabbitMQ queue.
In this lesson, we explore the scenario of optimizing message processing in RabbitMQ with multiple concurrent consumers. The challenge is addressed by introducing multiple consumers to handle the fast-paced production of messages by a short-interval producer. Spring's simplicity in managing concurrent consumers is demonstrated, ensuring efficient message processing without low-level thread programming. The lesson includes practical implementation details, such as setting concurrency parameters and utilizing Spring's capabilities to enhance processing speed in scenarios with varying producer-consumer speeds.
In this lesson, we address the challenges of diverse message formats in RabbitMQ. The flexibility of accepting any string as a message can lead to complications, especially when different producers use proprietary formats. To tackle this issue, the lesson introduces JSON as a standardized format for data interchange. JSON's widespread adoption and libraries like Jackson in Java simplify the parsing process, allowing applications to focus on business logic rather than intricate parsing rules. The lesson concludes with practical instructions on adding Jackson libraries to the project for seamless JSON handling in RabbitMQ messages.
In this lesson, we will learn about configuring RabbitMQ to handle JSON messages using Jackson dependencies. We create a shared `ObjectMapper` bean, define a Java class for employee data with JSON annotations, and develop a producer class to convert Java objects to JSON and send them to a RabbitMQ queue. The lesson focuses on enhancing source code readability and concludes with running the producer to send dummy employees to the queue.
In this lesson, we explore customization options for JSON representation using Jackson annotations in RabbitMQ. By using annotations like `@JsonProperty` and `@JsonFormat`, we can tailor attribute names and date formats to meet specific team standards, promoting clarity in data exchange. The practical demonstration involves modifying the attribute names in the producer and observing the changes in the generated JSON output.
In this lesson, we create a consumer in the RabbitMQ project, implementing the `EmployeeJsonConsumer` class that converts JSON messages from the "course.employee" queue into Java objects using the ObjectMapper. The lesson concludes by running the RabbitmqConsumerApplication and RabbitmqProducerApplication to demonstrate successful JSON-to-Java conversion in RabbitMQ, paving the way for future discussions on exchanges.
The lesson emphasizes the fundamental concept that engineers in a messaging system publish messages without specific knowledge of consumers. RabbitMQ, functioning as a message broker or "Unique Delivery Office," employs exchanges as employees to distribute messages to queues based on routing keys. The lesson introduces different types of exchanges, such as Fanout, Direct, and Topic, highlighting the correlation between exchanges and queues as bindings.
In this lesson, we explored the Fanout exchange in RabbitMQ, known as Pub/Sub or Publish/Subscribe. We learned how it broadcasts messages to all queues bound to the exchange, allowing multiple systems like Accounting and Marketing to process relevant data from a Human Resource System. Through naming conventions and a detailed schema, we created a Fanout exchange with two queue bindings and successfully implemented a Human Resource producer and corresponding Accounting and Marketing consumers.
In this lesson, we dive into the direct exchange in RabbitMQ, showcasing its ability to selectively route messages to specific queues based on routing keys and rules. Through a practical scenario involving picture processing, we created a Direct exchange named x.picture with two queues: q.picture.image and q.picture.vector. The producer generated ten dummy pictures, each processed by consumers based on routing keys "jpg" and "png" for image processing and "svg" for vector processing, demonstrating the precision of Direct exchanges in message distribution.
In this lesson, we will learn about Topic exchange in RabbitMQ, exploring its capability to route messages based on multiple criteria such as image source, size, and type. The scenario involves creating a topic exchange, defining queues for various processing tasks, and demonstrating how to produce and consume messages with complex routing keys. Through practical examples, we'll grasp the flexibility and power of Topic exchanges in RabbitMQ.
In this lesson, we will learn about using Postman and RabbitMQ's REST API to efficiently set up exchanges, queues, and bindings. The tutorial demonstrates the creation and execution of a Postman collection, streamlining the process of configuring RabbitMQ structures for the course. With Postman's capabilities, we explore essential functionalities such as executing requests, saving and organizing them in collections, and leveraging variables for flexibility in API development.
In this lesson, we will learn about handling message processing errors in RabbitMQ. Exploring scenarios where messages cannot be processed, such as due to large image sizes, we'll discover how to implement a dead letter exchange (DLX) to address issues like infinite loops caused by re-queuing exceptions. Additionally, we'll discuss strategies for managing situations where consumers are unavailable, ensuring efficient message handling and possible administrator notifications.
In this lesson, we delve into the Time To Live (TTL) concept in RabbitMQ, which represents the duration a message can exist in a queue without consumption. The TTL feature allows for handling scenarios like message expiration and triggering actions like sending messages to a dead letter exchange based on the configured TTL. This mechanism proves useful not only for managing unprocessed messages but also for implementing effective retry mechanisms.
In this lesson, we will explore error handling in RabbitMQ consumers, specifically focusing on scenarios where errors occur during message processing. Using a fanout exchange for simplicity, we'll simulate an error by modifying the producer to publish a large image, triggering an exception in the consumer. By observing the re-queuing behavior, we gain insights into how RabbitMQ handles invalid messages in such situations.
This lesson will explore RabbitMQ Dead Letter Exchange (DLX) and its role in handling unprocessable messages. We establish a mechanism to collect messages with processing issues by utilizing a fanout exchange as the dead letter exchange. We explore how DLX manages error scenarios, employing AmqpRejectAndDontRequeueException to avoid re-queuing problematic messages. This straightforward error-handling approach demonstrates the seamless integration of DLX in RabbitMQ.
This lesson will explore an alternative solution for handling errors by implementing manual rejection in RabbitMQ, adjusting the configuration in the consumer, and modifying the previous code to use manual acknowledgment. We achieve precise control over message rejection and acknowledgment through channel and delivery tags. This approach provides a nuanced way to manage error scenarios, ensuring messages are appropriately handled and, if necessary, redirected to the dead letter exchange.
In this lesson, we witnessed a demonstration of Time to Live (TTL) and a dead letter exchange in RabbitMQ. Using fanout exchanges "x.mypicture" for the primary process and "x.mypicture.dlx" as the dead letter exchange, we configured message TTL on "q.mypicture.image-ttl" to automatically redirect messages to the dead letter exchange if not processed within 5000 milliseconds. Observing the distinct handling of messages in "q.mypicture.image" and "q.mypicture.image-ttl," we gained insights into how TTL influences message behavior in RabbitMQ.
In this lesson, we will learn about headers exchanges in RabbitMQ, which operate similarly to topic exchanges but use message headers for routing. The tutorial covers the creation of headers exchanges, configuring custom headers for message routing, and demonstrates how to publish messages with specific headers. By setting up a practical example of furniture promotions, including discount and free delivery criteria, we gain a hands-on understanding of headers exchanges and their application in message routing.
New MAJOR Update!
ALL courses were re-recorded using Spring Boot 3!!
Better voice
Learn RabbitMQ Stream (and also RabbitMQ SuperStream)
New Update!
More advanced concepts and technical hands-on for RabbitMQ. OF course, the working source code included :
Automatically convert Java objects to/from JSON
Schedule consumers to stop/start at a given time
Consumer prefetch
Handle message ordering
A new way to write consumer
Consistent hash exchange
Request-reply pattern
Create RabbitMQ structures (queue, exchange, binding) from Java code
Install RabbitMQ using Docker. Works for all operating systems!
Use RabbitMQ plugins to extend functionalities
Don't want to install RabbitMQ? Use it on a cloud!
Retry mechanism without any code! (direct exchange)
Again, do the retry mechanism without writing code! (fanout exchange)
Additional bonus for modern architecture!
Single active consumer
Reliable publishing
Messaging System
Nowadays, we work with multiple systems and data that run among them. It's a common thing that one system triggers another system(s) process, or data needs to be transferred among systems. Whether your systems are built on monolith or microservice, whatever database you use, you need those data moving from one point to another. And you need those movements FAST to be processed immediately (otherwise, your life will be ruined).
That kind of demand is so common; fortunately, today's technology has an answer for that. Say hello to the messaging system, where you can send messages easily from one system to another system(s) asynchronously, in real-time intervals. There are some popular messaging systems in the market, and in this course, we will be talking about one of the most popular: RabbitMQ.
RabbitMQ
Rabbit MQ is like a central hub where you place all data from the source system(s), and the other corresponding systems take the data and process it. RabbitMQ is open-source, reliable, and able to work on clusters. It has a small learning curve to get started, yet powerful enough for system integrations.
This course includes everything you need to know about basic RabbitMQ and implementation using Java (Spring Framework). After finishing this course, you should be able to install, configure, and use RabbitMQ from the Java Program. In this course, we will walk through detailed step-by-step from concept to hands-on Java coding. Given such a way, you will learn to understand the logic behind and experience how things are done using Rabbit MQ and Java source codes.
Java and Spring Boot
Java itself has been a popular language for years. Several programming language indexes recognize Java as the world's most used programming language. Due to its popularity and long history, Java has many open-source projects or frameworks to help developers work more efficiently. One of the popular Java frameworks is Spring Framework. Over the years, Spring Framework has grown substantially among the Java community. Almost all software components required by a Java application are available within Spring Framework. However, configuring Spring requires some effort. This involves setting up library dependencies and configuring the required Java Spring beans using XML or annotations in Java code. Spring developers soon realized that automating much of this work was possible.
So 2014, Spring Boot 1.0 was released for the Java community. Spring Boot gives Java programmers a lot of automatic help and leads to Java developers' quick, large-scale adoption of the project. Fast forward to today, where Spring Boot has evolved, and the latest Spring Boot 3 provides many features to develop enterprise-level applications.
In real-world applications, Java with Spring and RabbitMQ can benefit data transfer among systems. Rabbit MQ is popular among Java developers, although RabbitMQ developers provide clients for multiple programming languages besides Java.
What You Will Get
After finishing the course, you will learn:
Installation of RabbitMQ and Java (In Windows. Currently, I don't have Linux/Mac)
RabbitMQ key concepts
Managing RabbitMQ from the web user interface
Create publisher and consumer using Java (Spring Boot)
Basic error handler if there is a failure during processing Rabbit MQ message
Retry mechanism on RabbitMQ if there is a failure message
Handle message ordering
The course will explain to you the theory of RabbitMQ and a lot of hands-on coding to get your hands dirty and your brain working. Whether you are a hobbyist, beginner, or experienced developer, this course will surely bring added value to you!
Road to Microservices
Message broker is one important pillar of microservice architecture. In microservice, we use asynchronous messaging for inter-service communication. Services communicating by exchanging messages over messaging channels like RabbitMQ.
In this course, you will learn the theory and hand-code of messaging with RabbitMQ and an introduction to REST API, another microservice architecture pillar.