16.2.0 • Published 8 months ago

@message-queue-toolkit/amqp v16.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

AMQP (Advanced Message Queuing Protocol)

The library provides support for both direct exchanges and topic exchanges.

NOTE: Check README.md for transport-agnostic library documentation.

Publishers

Use AbstractAmqpQueuePublisher to implement direct exchange and AbstractAmqpTopicPublisher for topic exchange.

See test publisher for an example of implementation.

Consumers

Use AbstractAmqpQueueConsumer to implement direct exchange and AbstractAmqpTopicConsumer for topic exchange.

See test consumer for an example of implementation.

Automatic Reconnects

message-queue-toolkit automatically reestablishes connections for all publishers and consumers via AmqpConnectionManager mechanism.

Example:

export const TEST_AMQP_CONFIG: AmqpConfig = {
  vhost: '',
  hostname: 'localhost',
  username: 'guest',
  password: 'guest',
  port: 5672,
  useTls: false,
}

const amqpConnectionManager = new AmqpConnectionManager(config, logger)
await amqpConnectionManager.init()

const publisher = new TestAmqpPublisher(
  { amqpConnectionManager },
  {
    // other amqp options
  },
)
await publisher.init()

const consumer = new TestAmqpConsumer(
  { amqpConnectionManager },
  {
    // other amqp options
  },
)
await consumer.start()

// break connection, to simulate unexpected disconnection in production
await (await amqpConnectionManager.getConnection()).close()

const message = {
  // some test message
}

// This will fail, but will trigger reconnection within amqpConnectionManager
publisher.publish(message)

// eventually connection is reestablished and propagated across all the AMQP services that use same amqpConnectionManager

// This will succeed and consumer, which also received new connection, will be able to consume it
publisher.publish(message)
16.2.0

8 months ago

15.1.1

1 year ago

15.1.2

1 year ago

15.3.0

1 year ago

15.5.0

1 year ago

16.1.1

10 months ago

16.1.0

11 months ago

15.2.0

1 year ago

15.2.1

1 year ago

15.4.0

1 year ago

16.0.0

12 months ago

15.1.0

1 year ago

15.0.0

1 year ago

14.1.0

1 year ago

14.0.0

1 year ago

13.0.0

1 year ago

12.0.3

1 year ago

12.0.2

1 year ago

12.0.0

1 year ago

12.0.1

1 year ago

11.1.0

1 year ago

11.0.1

1 year ago

11.0.0

1 year ago

10.0.0

1 year ago

9.0.0

1 year ago

8.0.0

2 years ago

7.0.0

2 years ago

3.4.0

2 years ago

1.2.0

2 years ago

3.3.0

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

3.5.0

2 years ago

6.1.0

2 years ago

6.0.0

2 years ago

3.0.0

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

4.0.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago