We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51eb899 commit 548bcd3Copy full SHA for 548bcd3
1 file changed
examples/stream.js
@@ -0,0 +1,15 @@
1
+import { AMQPClient } from '../lib/mjs/amqp-client.js'
2
+
3
+async function run() {
4
+ const amqp = new AMQPClient("amqp://localhost")
5
+ const conn = await amqp.connect()
6
+ let ch = await conn.channel()
7
+ await ch.prefetch(100)
8
+ let q = await ch.queue("stream1", {}, {"x-queue-type": "stream" })
9
+ const consumer = await q.subscribe({noAck: false, args: {"x-stream-offset": "first"}}, (msg) => {
10
+ console.log(msg.bodyString())
11
+ msg.ack()
12
+ })
13
+ await consumer.wait()
14
+}
15
+await run()
0 commit comments