Skip to content

tinkerscript/sqlssb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sqlssb

npm version JavaScript Style Guide

SQL Server Service Broker client for Node.js

Using

const Sqlssb = require('sqlssb')
const service1 = new Sqlssb({
  user: 'sa',
  password: '<PASSOWRD>',
  server: 'localhost',
  database: 'sqlssbb',
  service: 'sqlssb-demo-sample-service',
  queue: 'sqlssb-demo-sample-queue'
})

service1.on('sqlssb-demo-message-type', ctx => {
  console.log(ctx.conversationId);
  console.log(ctx.messageBody);
  console.log(ctx.messageTypeName);
  console.log(ctx.messageSequenceNumber);
  console.log(ctx.serviceName);
})

service1.start({ //default settings:
  timeout: 5000, //5 seconds
  count: 1 //one message at a time
})

Examples

See demo folder for more examples.

Development

To setup / reset demo stuff:

sqlcmd -S localhost -U sa -P Sqlssb01 -i demo/reset.sql

Tests:

npm test

About

SQL Server Service Broker client for Node.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published