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 created a generic function to share duplicate code between subscribeJSON and subscribeMsgPack. If you're curious this is the function signature:

export async function subscribe<T>(
  conn: amqp.ChannelModel,
  exchange: string,
  queueName: string,
  routingKey: string,
  simpleQueueType: SimpleQueueType,
  handler: (data: T) => Promise<AckType> | AckType,
  deserializer: (data: Buffer) => T,
): Promise<void>;
    • 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.