Recall & Review
beginner
What is TCP transport in NestJS?
TCP transport in NestJS is a way to send and receive messages over the TCP protocol, allowing microservices to communicate using TCP sockets.
Click to reveal answer
beginner
How do you create a TCP microservice in NestJS?
You create a TCP microservice by using the
Transport.TCP option in the createMicroservice() method of the NestJS app.Click to reveal answer
beginner
What is the role of
port in TCP transport configuration?The
port specifies the TCP port number where the microservice listens for incoming connections.Click to reveal answer
intermediate
How does NestJS handle message patterns with TCP transport?
NestJS uses decorators like
@MessagePattern() to listen for specific message patterns sent over TCP and respond accordingly.Click to reveal answer
intermediate
Why is TCP transport suitable for microservices?
TCP transport is suitable because it provides reliable, ordered, and error-checked delivery of messages between microservices over the network.
Click to reveal answer
Which NestJS method is used to create a TCP microservice?
✗ Incorrect
The createMicroservice() method is used with Transport.TCP to create a TCP microservice.
What does the
port option specify in TCP transport?✗ Incorrect
The port option defines the TCP port number where the microservice listens for connections.
Which decorator listens for messages in a TCP microservice?
✗ Incorrect
@MessagePattern() is used to listen for specific message patterns in TCP transport.
TCP transport in NestJS is mainly used for:
✗ Incorrect
TCP transport is designed for microservice communication over TCP sockets.
Which of the following is NOT a feature of TCP transport?
✗ Incorrect
TCP transport does not support broadcast messaging; it is point-to-point.
Explain how to set up a TCP microservice in NestJS and how it handles incoming messages.
Think about how NestJS creates and listens on TCP sockets.
You got /4 concepts.
Describe why TCP transport is a good choice for microservice communication in NestJS.
Consider the benefits of TCP protocol for sending messages.
You got /4 concepts.