Example files are not working because AMQPMixin is being called as a function even though src/index.js is exporting a JSON object. Removing the parens fixes the issue:
$ git diff head
diff --git a/examples/pub/index.js b/examples/pub/index.js
index 8a4c0f8..f3e5d63 100644
--- a/examples/pub/index.js
+++ b/examples/pub/index.js
@@ -7,7 +7,7 @@ let broker = new ServiceBroker({ logger: console });
broker.createService({
name: "pub",
- mixins: [AMQPMixin()],
+ mixins: [AMQPMixin],
started () {
let id = 1;
setInterval(() => {
diff --git a/examples/simple/index.js b/examples/simple/index.js
index c56adab..1422f1a 100644
--- a/examples/simple/index.js
+++ b/examples/simple/index.js
@@ -7,7 +7,7 @@ let broker = new ServiceBroker({ logger: console });
broker.createService({
name: "pub",
- mixins: [AMQPMixin()],
+ mixins: [AMQPMixin],
started () {
let id = 1;
setInterval(async () => {
@@ -19,7 +19,7 @@ broker.createService({
broker.createService({
name: "task-worker",
- mixins: [AMQPMixin()],
+ mixins: [AMQPMixin],
AMQPQueues: {
"sample.task" (channel, msg) {
let job = JSON.parse(msg.content.toString());
diff --git a/examples/worker/index.js b/examples/worker/index.js
index 0bfb59b..ad0976c 100644
--- a/examples/worker/index.js
+++ b/examples/worker/index.js
@@ -7,7 +7,7 @@ let broker = new ServiceBroker({ logger: console });
broker.createService({
name: "task-worker",
- mixins: [AMQPMixin()],
+ mixins: [AMQPMixin],
AMQPQueues: {
"sample.task" (channel, msg) {
let job = JSON.parse(msg.content.toString());
Example files are not working because AMQPMixin is being called as a function even though src/index.js is exporting a JSON object. Removing the parens fixes the issue: