Socket
Socket
Sign inDemoInstall

@neo4j/graphql-plugin-subscriptions-amqp

Package Overview
Dependencies
Maintainers
7
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j/graphql-plugin-subscriptions-amqp

Subscription plugin for @neo4j/graphql, supporting AMQP brokers such as RabbitMQ


Version published
Maintainers
7
Created
Source

@neo4j/graphql-plugin-subscriptions-amqp

Subscription plugin for @neo4j/graphql, currently supporting AMQP 0-9-1 brokers such as:

  • RabbitMQ
  • Apache Qpid
  • Apache ActiveMQ

Documentation

Installation

npm install @neo4j/graphql-plugin-subscriptions-amqp

Usage

const { Neo4jGraphQLSubscriptionsAMQPPlugin } = require("@neo4j/graphql-plugin-subscriptions-amqp");

const plugin = new Neo4jGraphQLSubscriptionsAMQPPlugin({
    connection: {
        hostname: "localhost",
        username: "guest",
        password: "guest",
    },
});

const neoSchema = new Neo4jGraphQL({
    typeDefs,
    driver,
    plugins: {
        subscriptions: plugin,
    },
});

To close the connection with RabbitMQ:

await plugin.close();

Options

The following options are available in the plugin.

  • connection: AMQP connection options or amqp url (e.g. amqp://localhost).
  • exchange: (optional) Queue exchange, defaults to neo4j.graphql.subscriptions.fx.
  • reconnectTimeout: (optional) Timeout (in ms) between reconnection attempts. If not set, the plugin will not reconnect. Note that if the first connection fails, it will not attempt to reconnect.
  • log: (optional) Enable AMQP logs, defaults to true.
  • amqpVersion: (optional) AMQP version to use, only 0-9-1 supported at the moment.

Running tests

  • yarn test to run unit tests
  • yarn test:e2e to run integration tests. These tests require a RabbitMQ instance running, and are not run by default
    • Use docker-compose up rabbitmq to spin up a RabbitMQ container for testing
    • Use docker-compose up qpid to spin up a Qpid container for testing

Licence

Apache 2.0

Keywords

FAQs

Package last updated on 24 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc