0
0
Redisquery~10 mins

Why pub/sub enables real-time messaging in Redis - Test Your Understanding

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

Complete the code to publish a message to a channel.

Redis
PUBLISH [1] "Hello, world!"
Drag options to blanks, or click blank then click option'
Aclient
Bsubscribe
Cmessage
Dnews
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'subscribe' instead of a channel name
Using 'message' as channel name which is too generic
2fill in blank
medium

Complete the code to subscribe to a channel for receiving messages.

Redis
SUBSCRIBE [1]
Drag options to blanks, or click blank then click option'
Anews
Bpublish
Cclient
Dmessage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'publish' which is a command, not a channel
Using 'client' which is unrelated
3fill in blank
hard

Fix the error in the command to subscribe to multiple channels.

Redis
SUBSCRIBE [1]
Drag options to blanks, or click blank then click option'
Anews,sports
Bnews sports
Cnews;sports
Dnews:sports
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or semicolons to separate channels
Using colons which is invalid
4fill in blank
hard

Fill both blanks to publish a message and subscribe to the same channel.

Redis
PUBLISH [1] "Update available"
SUBSCRIBE [2]
Drag options to blanks, or click blank then click option'
Aupdates
Bnews
Dalerts
Attempts:
3 left
💡 Hint
Common Mistakes
Using different channel names for publish and subscribe
Using unrelated channel names
5fill in blank
hard

Fill all three blanks to subscribe to channels and publish a message to one.

Redis
SUBSCRIBE [1] [2]
PUBLISH [3] "System rebooted"
Drag options to blanks, or click blank then click option'
Asystem
Balerts
Dupdates
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or other separators in SUBSCRIBE
Publishing to a channel not subscribed to