Skip to content

yaxinr/amqp-mssql-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Subscribtion - publication by amqp from mssql to anywere

Instructions

  • Run
go run main.go -amqp-uri=amqp://guest:guest@localhost:5672/ -queue=mssql-subscribe
  • Create and subscribe to queue "REPLYTO-QUEUE"
  • Publish message to queue "mssql-subscribe"
{
  reply_to: "REPLYTO-QUEUE"
  body: JSON
}

JSON =

{
  "ConnectionString": "sqlserver://username:password@host:port/instance?database=<Database>",
  "TableName"       : "<Table>",
  "Identity": "a_eq_1",
  "Select": "a",
  "IfUpdate": "update(a) or update(b)",
  "Where": "a='1'",
  "DetailsIncluded": true
}
  • Change data in Database Table
  • Wait for messages in queue "REPLYTO-QUEUE"

or create file mssql-listeners.json

{
    "test": {
        "ConnectionString": "sqlserver://username:password@host:port/instance?database=<Database>",
        "SchemaName": "dbo",
        "TableName"       : "<Table>",
        "Identity": "field1_eq_A",
        "Select": "field1",
        "IfUpdate": "update(field1) or update(field2)",
        "Where": "field1='A'",
        "DetailsIncluded": true
    }
}

and bind to exchange "URL.Host-URL.Port-URL.Path-database" with routingKey "TableName-Identity" (URL=ConnectionString)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages