Skip to content

Commit

Permalink
MQ testing with a fake message queue
Browse files Browse the repository at this point in the history
  • Loading branch information
goldbergyoni committed Apr 10, 2022
1 parent 649b786 commit 990471c
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 5,445 deletions.
5 changes: 3 additions & 2 deletions example-application/libraries/message-queue-client.js
Expand Up @@ -15,10 +15,11 @@ class MessageQueueClient extends EventEmitter {

// To facilitate testing, the client allows working with a fake MQ provider
// It can get one in the constructor here or even change by environment variables
// For the sake of simplicity HERE, since it's demo code - The default is a fake MQ
if (customMessageQueueProvider) {
this.messageQueueProvider = customMessageQueueProvider;
} else if (process.env.USE_FAKE_MQ === 'true') {
this.messageQueueProvider = new FakeMessageQueueProvider();
} else if (process.env.USE_FAKE_MQ === 'false') {
this.messageQueueProvider = amqplib;
} else {
this.messageQueueProvider = new FakeMessageQueueProvider();
}
Expand Down

0 comments on commit 990471c

Please sign in to comment.