0
0
RabbitMQdevops~10 mins

Topic exchange (pattern matching) in RabbitMQ - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare a topic exchange named 'logs'.

RabbitMQ
channel.exchange_declare(exchange='logs', exchange_type='[1]')
Drag options to blanks, or click blank then click option'
Adirect
Bfanout
Ctopic
Dheaders
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'direct' instead of 'topic' exchange type.
2fill in blank
medium

Complete the binding key to receive all logs from any service.

RabbitMQ
channel.queue_bind(exchange='logs', queue='all_logs', routing_key='[1]')
Drag options to blanks, or click blank then click option'
Aservice.*
B*.logs
Clogs.#
D#
Attempts:
3 left
💡 Hint
Common Mistakes
Using '*' which matches exactly one word only.
3fill in blank
hard

Fix the error in the binding key to receive logs only from 'auth' service with any severity.

RabbitMQ
channel.queue_bind(exchange='logs', queue='auth_logs', routing_key='[1]')
Drag options to blanks, or click blank then click option'
Aauth.*
B*.auth
Cauth.#
D#.auth
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'auth.#' which matches zero or more words, not just one.
4fill in blank
hard

Fill both blanks to bind a queue to receive error logs from any service.

RabbitMQ
channel.queue_bind(exchange='logs', queue='error_logs', routing_key='[1].[2]')
Drag options to blanks, or click blank then click option'
A*
Berror
C#
Dlogs
Attempts:
3 left
💡 Hint
Common Mistakes
Using '#' which matches zero or more words, not exactly one.
5fill in blank
hard

Fill all three blanks to create a binding key that matches logs from 'auth' or 'payment' services with any severity.

RabbitMQ
binding_keys = ['auth.[1]', 'payment.[2]', '[3]']
Drag options to blanks, or click blank then click option'
A*
B#
Cerror
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using specific severity words instead of wildcards.