Noctiflorous Pansy Mulch

    @alliedpayment/message-bridge
    TypeScript icon, indicating that this package has built-in type declarations

    3.2.5 • Public • Published

    @alliedpayment/message-bridge

    Bridge to send RabbitMQ messages to Allied's queues.

    Allied uses NServiceBus which requires special headers.

    This bridge wraps ampqlib and providing publisher API that handles the needed headers.

    Notes:

    • environment variable RABBITMQ_CONNECTION_STRING is expected to be set

    example:

    "amqp://guest:guest@localhost:5672"

    Usage

    import bus, { IMessage } from "../src/index";
    
    const queue = "test";
    
    const run = async () => {
      const message: IMessage = {
        $type: "Allied.Data.NServiceBus.Messages.Test.TestMessage",
        payload: {
          id: "123",
          test: "test",
        },
      };
      try {
        const result = await bus.send(queue, message);
        log.info(`send result: ${result ? "successful" : "failed"}`);
        process.exit(0);
      } catch (error) {
        log.error(error);
        process.exit(1);
      }
    };
    
    run();

    Install

    npm i @alliedpayment/message-bridge

    DownloadsWeekly Downloads

    32

    Version

    3.2.5

    License

    MIT

    Unpacked Size

    15.7 kB

    Total Files

    14

    Last publish

    Collaborators

    • connor.skees
    • wickdninja