1.2.4 • Published 3 months ago
@zeroq/amqp-wrapper v1.2.4
ZeroQ AMPQ wrapper
Usage
import * as broker from "@zeroq/amqp-wrapper"
//first connect to amqp server (rabbitmq)
await broker.connect(
connString,
{
name: "offices", //exchange name
type: "topic" //exchange type
},
true, //if true create a channel for subscribers
true, //if true create a channel for publisher
)
//if createChannelSubsriber is true, then you can add subscribers
const subscriber = await broker.addSubscriber(
"queue_name",
"#.route.key",
{
name: "offices", //exchange name
type: "topic" //exchange type
},
);
//now you can listen messages
attentionsSubscriber.listen(async (content) => {
// the listen function do the ack() or nack() when is an error
//use the try/catch block
try{
//do your logic here
}catch (e) {
throw e
}
})
//to publish messages it's required createPublisherChannel in true in connect function
await broker.publish(
'zeroq.route.key', //check this link to review the routink key format https://www.notion.so/zeroq/Formato-de-colas-y-routing-keys-de-broker-1669f3dd032c4717817395074e48c4f3#719d4f95e78e4e49a82b923670c1be30
{
key:"data"
} //an object with the message to send
)
1.2.4
3 months ago
1.2.3
3 months ago
1.2.0
2 years ago
1.1.1
2 years ago
1.0.19
2 years ago
1.0.2
2 years ago
1.1.0
2 years ago
1.0.18
2 years ago
1.0.1
2 years ago
1.0.17
2 years ago
1.0.0
2 years ago
1.0.16
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.2.2
1 year ago
1.1.3
2 years ago
1.0.4
2 years ago
1.2.1
2 years ago
1.1.2
2 years ago
1.0.3
2 years ago
0.0.52
2 years ago
0.0.53
2 years ago
0.0.54
2 years ago
0.0.55
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
0.0.51
2 years ago
0.0.50
2 years ago