graphql-amqp-connection-manager-subscriptions
TypeScript icon, indicating that this package has built-in type declarations

1.0.17 • Public • Published

graphql-amqp-connection-manager-subscriptions

Implements the PubSubEngine Interface from the graphql-subscriptions package. It allows you to connect your subscriptions manager to the PubSub mechanism and reuse the existing amqp-connection-manager connection.

This package is influenced by graphql-amqp-subscriptions.

npm Version npm Downloads

Basic usage

import { AMQPConnectionManagerPubSub } from 'graphql-amqp-connection-manager-subscriptions';
import { connect } from 'amqp-connection-manager';

const connection = connect('amqp://guest:guest@localhost:5672?heartbeat=20');
const pubsub = new AMQPConnectionManagerPubSub({
  // Required
  connection,

  // Optional
  exchange: {
    name: 'exchange',
    type: 'topic',
    options: {
      durable: false,
      autoDelete: true,
    },
  },

  // Optional
  queue: {
    name: 'queue'
    options: {
      exclusive: true,
      durable: true,
      autoDelete: true,
    },
  },
});

Debug

This package uses Debug. To show the logs run your app with the environment variable DEBUG="AMQPConnectionManagerPubSub"

Package Sidebar

Install

npm i graphql-amqp-connection-manager-subscriptions

Weekly Downloads

6

Version

1.0.17

License

MIT

Unpacked Size

24 kB

Total Files

17

Last publish

Collaborators

  • slavikp