mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-03-15 15:06:04 +01:00
more tests things
This commit is contained in:
parent
a7dba08990
commit
1cb4e21691
14 changed files with 98 additions and 40 deletions
14
test-js/src/send-single-message.js
Normal file
14
test-js/src/send-single-message.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { connect } from 'amqplib';
|
||||
|
||||
const connection = await connect('amqp://localhost');
|
||||
|
||||
const channel = await connection.createChannel();
|
||||
|
||||
channel.publish('exchange-1', 'queue-1', Buffer.from('hello'));
|
||||
|
||||
console.log('Published message');
|
||||
|
||||
await channel.close();
|
||||
await connection.close();
|
||||
|
||||
console.log('Successfully shut down connection');
|
||||
Loading…
Add table
Add a link
Reference in a new issue