0.5.0 • Published 2 months ago

@opzkit/nodeamqp v0.5.0

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

nodeamqp

Nodeamqp provides an opinionated way of using RabbitMQ for event-driven architectures.

Getting Started

Add the dependency

yarn add @opzkit/nodeamqp

Usage

See the 'examples' subdirectory.

Contributing

TODO

References

License

MIT - see LICENSE for more details.

Developing

TODO

Tests

yarn run test

Example message logger

An example message logger which dumps messages to console.

const StdOutMessageLogger = (
  content: Buffer,
  routingKey: string,
  outgoing: boolean
) => {
  let out: string = content.toString("utf-8");
  try {
    out = JSON.stringify(JSON.parse(out), null, 2);
  } catch (e) {
    // Ignore errors since out is already set
  }
  if (outgoing) {
    console.log(
      `Sending using routingkey: '${routingKey}' with content:\n${out}\n`
    );
  } else {
    console.log(
      `Received from routingkey '${routingKey}' with content:\n${out}\n`
    );
  }
};
0.5.0

2 months ago

0.4.0

1 year ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago