0
0
RabbitMQdevops~10 mins

Transaction mode vs confirms in RabbitMQ - Interactive Practice

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

Complete the code to start a transaction in RabbitMQ channel.

RabbitMQ
channel.[1]()
Drag options to blanks, or click blank then click option'
Acommit
Btx_select
Cbasic_publish
Dconfirm_select
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' to start transaction instead of 'tx_select'.
Confusing confirms with transactions.
2fill in blank
medium

Complete the code to enable publisher confirms on the channel.

RabbitMQ
channel.[1]()
Drag options to blanks, or click blank then click option'
Aconfirm_select
Btx_select
Ctx_commit
Dbasic_ack
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'tx_select' instead of 'confirm_select'.
Trying to commit before enabling confirms.
3fill in blank
hard

Fix the error in the code to commit a transaction.

RabbitMQ
channel.[1]()
Drag options to blanks, or click blank then click option'
Atx_select
Bconfirm_select
Ctx_commit
Dbasic_publish
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'tx_select' to commit instead of 'tx_commit'.
Using 'confirm_select' to commit transactions.
4fill in blank
hard

Fill both blanks to publish a message and wait for confirms.

RabbitMQ
channel.basic_publish(exchange='', routing_key='task_queue', body='Hello')
channel.[1]()
channel.[2]()
Drag options to blanks, or click blank then click option'
Await_for_confirms
Btx_commit
Ctx_select
Dconfirm_select
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'confirm_select' instead of 'wait_for_confirms'.
Mixing transaction start and commit methods.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension filtering messages with length greater than 5 and publishing them with confirms.

RabbitMQ
messages = {'msg1': 'Hello', 'msg2': 'Welcome', 'msg3': 'Hi there'}
filtered = {k: v for k, v in messages.items() if len(v) [1] 5}
channel.[2]()
for key, msg in filtered.items():
    channel.basic_publish(exchange='', routing_key='queue', body=msg)
channel.[3]()
Drag options to blanks, or click blank then click option'
A>
Bconfirm_select
Cwait_for_confirms
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' in filter.
Not enabling confirms before publishing.
Not waiting for confirms after publishing.