Skip to content

Commit a08507d

Browse files
committed
dump moleculer to v0.15-beta2
1 parent 4f2fcde commit a08507d

File tree

4 files changed

+371
-114
lines changed

4 files changed

+371
-114
lines changed

examples/dead-letter/index.js

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,28 @@ const broker = new ServiceBroker({
1616
adapter: process.env.ADAPTER || "redis://localhost:6379"
1717
})
1818
],
19-
replCommands: [
20-
{
21-
command: "publish",
22-
alias: ["p"],
23-
async action(broker, args) {
24-
const payload = {
25-
id: 2,
26-
name: "Jane Doe",
27-
status: false,
28-
count: ++c,
29-
pid: process.pid
30-
};
19+
replOptions: {
20+
customCommands: [
21+
{
22+
command: "publish",
23+
alias: ["p"],
24+
async action(broker, args) {
25+
const payload = {
26+
id: 2,
27+
name: "Jane Doe",
28+
status: false,
29+
count: ++c,
30+
pid: process.pid
31+
};
3132

32-
await broker.sendToChannel("my.fail.topic", payload, {
33-
key: "" + c,
34-
headers: { a: "123" }
35-
});
33+
await broker.sendToChannel("my.fail.topic", payload, {
34+
key: "" + c,
35+
headers: { a: "123" }
36+
});
37+
}
3638
}
37-
}
38-
]
39+
]
40+
}
3941
});
4042

4143
broker.createService({
@@ -84,6 +86,9 @@ broker.createService({
8486
handler(ctx, raw) {
8587
this.logger.info("--> FAILED HANDLER PARAMS <--");
8688
this.logger.info(ctx.params);
89+
this.logger.info("--> FAILED HANDLER HEADERS <--");
90+
this.logger.info(ctx.headers);
91+
8792
// Send a notification about the failure
8893

8994
this.logger.info("--> RAW (ENTIRE) MESSAGE <--");

0 commit comments

Comments
 (0)