0.14.0 • Published 5 years ago

@sigodenjs/dee-natstreaming v0.14.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Dee MQ Service

A mq service for dee framework, powered by nats-streaming

Usage

import * as DeeNatstreaming from "@sigodenjs/dee-natstreaming";

Dee({
  services: {
    mq: {
      initialize: DeeNatstreaming.init,
      args: {
        client: {
          clusterId: "test-cluster",
          stanOptions: {
            url: "nats://localhost:4222"
          }
        },
        producers: {
          sayHello: {
            schema: {
              name: { type: "string" }
            }
          }
        },
        subscribers: {
          "App.sayHello": {}
        },
        handlers: {
          "App.sayHello": (ctx: DeeNatstreaming.Context) => {
            expect(ctx.srvs).toBeDefined();
            expect(ctx.msg.getData().toString()).toBe('{"name":"tom"}');
          }
        }
      }
    }
  }
});

await srvs.mq.producers.sayHello({ name: "tom" });
0.14.0

5 years ago

0.13.1

5 years ago

0.13.0

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.7

5 years ago

0.11.6

6 years ago

0.11.4

6 years ago

0.11.1

6 years ago

0.11.0

6 years ago

0.10.5

6 years ago

0.10.2

6 years ago

0.10.1

6 years ago

0.10.0

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.8.4

6 years ago

0.8.2

6 years ago