So far in this series, we’ve been using Docker Compose to work with Postgres and Elasticsearch. The queue of messages might pile quite a bit, but no data is lost. When a bug is found, a faulty microservice can be stopped and restarted after it is resolved. CloudAMQP, in its article, also mentions that it helped them a lot in keeping the architecture flexible and fixing bugs. Therefore, we can separate our microservices more and make them less dependant on each other. With a message queue, we can send a message from one service to another without knowing if it can handle it. the consumer takes the message from the queue and consumes it.Īdvantages of using RabbitMQ with microservices.the exchange receives the message and routes it to the desired queue,.the producer sends a message to the exchange,.When sending the message, the publisher can send the message to specified queues.įinally, the consumer picks up the message from the queue and handles it. We can bind the exchange to many different queues. The producer sends the messages through the exchange, which is a message routing agent. When the producer sends the message, it lands in the queue. The second important thing is the consumer that waits to receive messages.īetween the producer and the consumer is a queue. One of the most important concepts to understand is the producer (also called a publisher), whose job is to send the messages. The RabbitMQ is its fundamentals, a message broker that implements the Advanced Message Queuing Protocol ( AMQP). Conveniently, Nest provides an abstraction for each transport layer, so it is easy to switch them without making significant changes to our code. Each one of them is different, and it is worth exploring them before making a choice. However, with NestJS, we have a broad selection of transporters that transmit messages across microservices. Therefore, in the previous part of this series, we’ve used TCP. NestJS subscribes to the idea that a microservice is an application that uses a different transport layer than HTTP. Updating entities with PUT and PATCH using raw SQL queries Implementing searching with pattern matching and raw SQL Generating statistics using aggregate functions in raw SQL Offset and keyset pagination with raw SQL queries Working with transactions using raw SQL queries Many-to-many relationships using raw SQL queries Designing many-to-one relationships using raw SQL queries One-to-one relationships with raw SQL queries Working with PostgreSQL using raw SQL queries Interacting with the application through REPL Improving PostgreSQL performance with indexes using MikroORM Implementing soft deletes using MikroORM and filters Transactions with PostgreSQL and MikroORM Relationships with PostgreSQL and MikroORM Introduction to a monorepo with Lerna and Yarn workspaces Using ETag to implement cache and save bandwidth Storing files inside a PostgreSQL database Implementing soft deletes with PostgreSQL and TypeORM Generating documentation with Compodoc and JSDoc Introduction to logging with the built-in logger and TypeORM Updating with PUT and PATCH with MongoDB and Mongoose Definining indexes with MongoDB and Mongoose Implementing pagination with MongoDB and Mongoose Managing transactions with MongoDB and Mongoose Virtual properties with MongoDB and Mongoose Verifying phone numbers and sending SMS messages with Twilio Setting up recurring payments via subscriptions with Stripe Using Stripe to save credit cards for future use Using server-side sessions instead of JSON Web Tokens Managing PostgreSQL relationships with Prisma Real-time updates with GraphQL subscriptions Sending scheduled emails with cron and Nodemailer Implementing in-memory cache to increase the performance Communicating with microservices using the gRPC framework Using RabbitMQ to communicate with microservices Offset and keyset pagination with PostgreSQL and TypeORM Using the array data type with PostgreSQL and TypeORM Defining transactions with PostgreSQL and TypeORM Improving performance of our Postgres database with indexes Testing services and controllers with integration tests Creating relationships with Postgres and TypeORM Looking into dependency injection and modules Serializing the response with interceptors Authenticating users with bcrypt, Passport, JWT, and cookies Setting up a PostgreSQL database with TypeORM Controllers, routing and the module structure This entry is part 19 of 80 in the API with NestJS
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |