We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Consume Logs

Now let's consume the logs and save them to disk.

Assignment

*.log

I used generics to create a helper function to share duplicate code between SubscribeJSON and SubscribeGob. If you're curious this was the function signature of the helper:

func subscribe[T any](
	conn *amqp.Connection,
	exchange,
	queueName,
	key string,
	simpleQueueType SimpleQueueType,
	handler func(T) Acktype,
	unmarshaller func([]byte) (T, error),
) error
    • Because your queue has some logs in it, you should see them get consumed as soon as you restart the server.
    • Make sure that the game.log file contains the logs you expect.
    • Ensure all the messages from the game_logs queue are consumed using the Rabbit UI.

Run and submit the CLI tests.