https://github.com/restuwahyu13/node-rabbitmq-ae
Example rabbitmq alternate exchange configuration policy
https://github.com/restuwahyu13/node-rabbitmq-ae
message-broker node queue rabbitmq
Last synced: 2 months ago
JSON representation
Example rabbitmq alternate exchange configuration policy
- Host: GitHub
- URL: https://github.com/restuwahyu13/node-rabbitmq-ae
- Owner: restuwahyu13
- Created: 2023-02-26T17:23:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-26T17:23:17.000Z (about 2 years ago)
- Last Synced: 2025-01-03T17:51:40.790Z (4 months ago)
- Topics: message-broker, node, queue, rabbitmq
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RABBITMQ AE (Alternate Exchange)
Check this tutorial about alternate exchange using **rabbitmq** [here](https://www.rabbitmq.com/ae.html), if you need tutorial about rabbitmq check my repo [here](https://github.com/restuwahyu13/node-rabbitmq).
## Server Alternate Exchange
```ts
import { RabbitMQ } from './rabbitmq'const rabbitmq: InstanceType = new RabbitMQ()
rabbitmq.consumerAe('users')process.on('SIGINT', function () {
console.log(`Terminated process: ${process.pid} successfully`)
process.exit(0)
})setInterval(() => console.log('...........................'), 3000)
```## Client Alternate Exchange
```ts
import { faker } from '@faker-js/faker'
import { RabbitMQ } from './rabbitmq'const requestData: Record = {
id: faker.datatype.uuid(),
name: faker.name.fullName(),
country: faker.address.country(),
city: faker.address.city(),
postcode: faker.address.zipCode()
}const rabbitmq: InstanceType = new RabbitMQ()
rabbitmq.publishAe('users', requestData).then((value: any) => {
console.log(`Publishing data success `, value)
})
```