Running a simple example
Creating a producer
import { Queue } from "bullmq";
import { BullMQOtel } from "bullmq-otel";
const queue = new Queue("myQueue", {
connection: {
host: "127.0.0.1",
port: 6379,
},
telemetry: new BullMQOtel("simple-guide"),
});
const jobsBulk = Array.from({ length: 5 }, (_, i) => i);
(async () => {
for (let i = 0; i < 10; i++) {
await queue.addBulk(
jobsBulk.map((j) => ({
name: `myJob ${j}`,
data: { i: j },
opts: { attempts: 2, backoff: 1000 },
}))
);
}
})();Creating a consumer
Creating the instrumentation files
Launching the services





Last updated
Was this helpful?