Module 7, 8, 9, 10, 11 - Interprocess communication Flashcards
1
Q
Why is there a need for interprocess communication
A
- Exchange data with another microservice
2. Induce status change/invoke business logic in another microservice
2
Q
Types of communication pattern
A
- How many receivers
- 1 receiver = one-to-one
- Many receivers = one-to-many
- Selected receivers = one-to-selected
- Does the sender expect a reply
- No: Fire-and-forget
- Yes: Request- reply
3
Q
Types of communication technologies
A
- Invocation-based (HTTP Calls, function calls)
2. Messaging based (go through message broker)
4
Q
Characteristics of invocation-based
A
- Tightly coupled (if one go down, cannot work)
- Code dependencies
- Don’t need to maintain broker
- If receiver offline, sender cannot send data
5
Q
Characteristics of messaging-based
A
- Single point of failure in the messaging broker
- Less tightly coupled than invocation
- Can help facilitate 1-many communication
- Need to maintain broker
- Even if receiver die, sender still can send data and data is stored in queue.
6
Q
For messaging-based, does the receiver need to attend to message immediately
A
No. Messages stored at the queue and the receiver listen to the queue whenever
7
Q
What is inside a message
A
- Networking info
- Properties
- Message body
8
Q
What is AMQP, RabbitMQ, Pika
A
Advanced messaging queuing protocol
As long as both sides AMQP compliant, can use AMQP technologies
RabbitMQ is implementation of AMQP Pika is python module that allows the use of RabbitMQ
9
Q
Types of exchange
A
- Direct exchange
- Deliver message whose routing key matches exactly the binding key of the queue - Topic exchange
- Does wildcard matching between routing key of message and binding key of queue
- * means exactly 1
- # means 0 or many - Fanout exchange
- Send the message to every queue bound to the exchange
10
Q
In a request reply, what does the sender need to send
A
- Correlation ID
2. Reply-to-queue