Complete the code to subscribe to a Redis channel named 'news'.
SUBSCRIBE [1]The SUBSCRIBE command listens to a specific channel. Here, 'news' is the channel name.
Complete the code to add a message to a Redis stream named 'mystream'.
XADD mystream * [1] messageThe XADD command adds an entry to a stream. 'field1' is the field name for the message.
Fix the error in the command to read messages from a stream 'mystream' starting from the last ID.
XREAD COUNT 10 STREAMS mystream [1]
The XREAD command uses '$' to read new messages added after the command runs.
Fill both blanks to publish a message 'Hello' to channel 'chatroom' and add the same message to stream 'chatstream'.
PUBLISH [1] 'Hello' XADD [2] * message 'Hello'
PUBLISH sends a message to a channel, and XADD adds a message to a stream. Here, 'chatroom' is the channel and 'chatstream' is the stream.
Fill all three blanks to create a consumer group 'group1' for stream 'orders', read new messages, and acknowledge message ID '1526985058136-0'.
XGROUP CREATE [1] [2] $ MKSTREAM XREADGROUP GROUP [1] consumer1 COUNT 10 STREAMS [2] > XACK [2] [1] 1526985058136-0
XGROUP CREATE creates a consumer group named 'group1' for the stream 'orders'. XREADGROUP reads messages for that group, and XACK acknowledges a message ID for the same group and stream.