{
  "notice": {
    "n0": "This file is produced by CirrusWave line of products and platform.",
    "n1": "By producing this file and using this product you are agreeing to the terms and conditions outlined in the CirrusWave Enterprise License",
    "n2": "Please make sure that you read CirrusWave license at https://www.cirruswave.com/eula.html"
  },
  "loglevel": "trace",
  "servicename": "rabbitmq",
  "routes": [
    {
      "route": "/images",
      "type": "static",
      "configured": true,
      "routeclass": "./images",
      "description": "app specific images are served from the directory ./images under "
    },
    {
      "route": "/publishers",
      "type": "post",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "Publish",
      "description": "Publish a message",
      "bodyschema": {
        "type": "object",
        "oneOf": [
          {
            "required": [
              "queuename"
            ]
          },
          {
            "required": [
              "exchange",
              "topic"
            ]
          }
        ],
        "properties": {
          "exchange": {
            "type": "string",
            "description": "uniquename for an exchange"
          },
          "topics": {
            "type": "string",
            "description": "topic can be a word or multiple words separated by period. A word can be * which matches any word. # matches multiple words separated by . e.g see https://www.rabbitmq.com/tutorials/tutorial-five-python.html"
          },
          "queuename": {
            "type": "string",
            "description": "unique queue name that identifies the message queue"
          }
        }
      },
      "examples": [
        {
          "param": "/publishers",
          "payload": {
            "queuename": "abced197e0kfa",
            "message": {
              "header": "car info",
              "body": [
                {
                  "manufacturer": "Porsche",
                  "model": "911",
                  "price": 135000,
                  "wiki": "http://en.wikipedia.org/wiki/Porsche_997",
                  "img": "2004_Porsche_911_Carrera_type_997.jpg"
                },
                {
                  "manufacturer": "Nissan",
                  "model": "GT-R",
                  "price": 80000,
                  "wiki": "http://en.wikipedia.org/wiki/Nissan_Gt-r",
                  "img": "250px-Nissan_GT-R.jpg"
                },
                {
                  "manufacturer": "BMW",
                  "model": "M3",
                  "price": 60500,
                  "wiki": "http://en.wikipedia.org/wiki/Bmw_m3",
                  "img": "250px-BMW_M3_E92.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "S5",
                  "price": 53000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_S5#Audi_S5",
                  "img": "250px-Audi_S5.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "TT",
                  "price": 40000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_TT",
                  "img": "250px-2007_Audi_TT_Coupe.jpg"
                }
              ]
            }
          }
        },
        {
          "param": "/publishers",
          "payload": {
            "queuename": "secondqueue",
            "message": {
              "header": "car info",
              "body": [
                {
                  "manufacturer": "Porsche",
                  "model": "911",
                  "price": 135000,
                  "wiki": "http://en.wikipedia.org/wiki/Porsche_997",
                  "img": "2004_Porsche_911_Carrera_type_997.jpg",
                  "date": "Jan 30, 1990"
                },
                {
                  "manufacturer": "Nissan",
                  "model": "GT-R",
                  "price": 80000,
                  "wiki": "http://en.wikipedia.org/wiki/Nissan_Gt-r",
                  "img": "250px-Nissan_GT-R.jpg"
                },
                {
                  "manufacturer": "BMW",
                  "model": "M3",
                  "price": 60500,
                  "wiki": "http://en.wikipedia.org/wiki/Bmw_m3",
                  "img": "250px-BMW_M3_E92.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "S5",
                  "price": 53000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_S5#Audi_S5",
                  "img": "250px-Audi_S5.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "TT",
                  "price": 40000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_TT",
                  "img": "250px-2007_Audi_TT_Coupe.jpg"
                }
              ]
            }
          }
        },
        {
          "param": "/publishers",
          "payload": {
            "queuename": "thirdqueue",
            "message": {
              "models": [
                "Porsche",
                "Nissan",
                "BMW",
                "M3",
                "S5",
                "TT"
              ]
            }
          }
        },
        {
          "param": "/publishers",
          "payload": {
            "exchange": "exch1",
            "topic": "topic11",
            "message": {
              "header": "car info",
              "body": [
                {
                  "manufacturer": "Porsche",
                  "model": "911",
                  "price": 135000,
                  "wiki": "http://en.wikipedia.org/wiki/Porsche_997",
                  "img": "2004_Porsche_911_Carrera_type_997.jpg"
                },
                {
                  "manufacturer": "Nissan",
                  "model": "GT-R",
                  "price": 80000,
                  "wiki": "http://en.wikipedia.org/wiki/Nissan_Gt-r",
                  "img": "250px-Nissan_GT-R.jpg"
                },
                {
                  "manufacturer": "BMW",
                  "model": "M3",
                  "price": 60500,
                  "wiki": "http://en.wikipedia.org/wiki/Bmw_m3",
                  "img": "250px-BMW_M3_E92.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "S5",
                  "price": 53000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_S5#Audi_S5",
                  "img": "250px-Audi_S5.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "TT",
                  "price": 40000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_TT",
                  "img": "250px-2007_Audi_TT_Coupe.jpg"
                }
              ]
            }
          }
        },
        {
          "param": "/publishers",
          "payload": {
            "exchange": "exch1",
            "topic": "topic12",
            "message": {
              "header": "car info",
              "body": [
                {
                  "manufacturer": "Porsche",
                  "model": "911",
                  "price": 135000,
                  "wiki": "http://en.wikipedia.org/wiki/Porsche_997",
                  "img": "2004_Porsche_911_Carrera_type_997.jpg"
                },
                {
                  "manufacturer": "Nissan",
                  "model": "GT-R",
                  "price": 80000,
                  "wiki": "http://en.wikipedia.org/wiki/Nissan_Gt-r",
                  "img": "250px-Nissan_GT-R.jpg"
                },
                {
                  "manufacturer": "BMW",
                  "model": "M3",
                  "price": 60500,
                  "wiki": "http://en.wikipedia.org/wiki/Bmw_m3",
                  "img": "250px-BMW_M3_E92.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "S5",
                  "price": 53000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_S5#Audi_S5",
                  "img": "250px-Audi_S5.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "TT",
                  "price": 40000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_TT",
                  "img": "250px-2007_Audi_TT_Coupe.jpg"
                }
              ]
            }
          }
        },
        {
          "param": "/publishers",
          "payload": {
            "exchange": "exch2",
            "topic": "topic21",
            "message": {
              "header": "car info",
              "body": [
                {
                  "manufacturer": "Porsche",
                  "model": "911",
                  "price": 135000,
                  "wiki": "http://en.wikipedia.org/wiki/Porsche_997",
                  "img": "2004_Porsche_911_Carrera_type_997.jpg"
                },
                {
                  "manufacturer": "Nissan",
                  "model": "GT-R",
                  "price": 80000,
                  "wiki": "http://en.wikipedia.org/wiki/Nissan_Gt-r",
                  "img": "250px-Nissan_GT-R.jpg"
                },
                {
                  "manufacturer": "BMW",
                  "model": "M3",
                  "price": 60500,
                  "wiki": "http://en.wikipedia.org/wiki/Bmw_m3",
                  "img": "250px-BMW_M3_E92.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "S5",
                  "price": 53000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_S5#Audi_S5",
                  "img": "250px-Audi_S5.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "TT",
                  "price": 40000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_TT",
                  "img": "250px-2007_Audi_TT_Coupe.jpg"
                }
              ]
            }
          }
        },
        {
          "param": "/publishers",
          "payload": {
            "exchange": "exch2",
            "topic": "topic22",
            "message": {
              "header": "car info",
              "body": [
                {
                  "manufacturer": "Porsche",
                  "model": "911",
                  "price": 135000,
                  "wiki": "http://en.wikipedia.org/wiki/Porsche_997",
                  "img": "2004_Porsche_911_Carrera_type_997.jpg"
                },
                {
                  "manufacturer": "Nissan",
                  "model": "GT-R",
                  "price": 80000,
                  "wiki": "http://en.wikipedia.org/wiki/Nissan_Gt-r",
                  "img": "250px-Nissan_GT-R.jpg"
                },
                {
                  "manufacturer": "BMW",
                  "model": "M3",
                  "price": 60500,
                  "wiki": "http://en.wikipedia.org/wiki/Bmw_m3",
                  "img": "250px-BMW_M3_E92.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "S5",
                  "price": 53000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_S5#Audi_S5",
                  "img": "250px-Audi_S5.jpg"
                },
                {
                  "manufacturer": "Audi",
                  "model": "TT",
                  "price": 40000,
                  "wiki": "http://en.wikipedia.org/wiki/Audi_TT",
                  "img": "250px-2007_Audi_TT_Coupe.jpg"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "route": "/subscribers",
      "type": "get",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "GetSubscribers",
      "description": "Get all the subscriptions",
      "examples": [
        {
          "param": "/subscribers"
        }
      ]
    },
    {
      "route": "/subscribers",
      "type": "post",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "Subscribe",
      "description": "Subscribe to a message. Requires an url or service endpoint that receives post. The message when available will be posted to each of the subscribers",
      "bodyschema": {
        "type": "object",
        "oneOf": [
          {
            "required": [
              "queuename",
              "receiver"
            ]
          },
          {
            "required": [
              "exchange",
              "topics",
              "receiver"
            ]
          }
        ],
        "properties": {
          "exchange": {
            "type": "string",
            "description": "uniquename for an exchange"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "topic can be a word or multiple words separated by period. A word can be * which matches any word. # matches multiple words separated by . e.g see https://www.rabbitmq.com/tutorials/tutorial-five-python.html"
            }
          },
          "queuename": {
            "type": "string",
            "description": "unique queue name that identifies the message queue"
          },
          "expr": {
            "type": "object",
            "description": "an  expression with variables of the form a.b.c which evaluates by walking the message and matching the fields in the message according to the dot convention. and then compares it to the right value or expression. If theare syntax errors it does not result in a match. console.log will dispaly the errors",
            "oneOf": [
              {
                "required": [
                  "op",
                  "varLeft",
                  "valRight"
                ]
              },
              {
                "required": [
                  "op",
                  "varLeft",
                  "varRight"
                ]
              },
              {
                "required": [
                  "op",
                  "valLeft",
                  "varRight"
                ]
              }
            ],
            "properties": {
              "varLeft": {
                "type": "string",
                "description": "variable expression that follows dot notiation to walk the msg structure. Array elements are referred to by their integer index"
              },
              "varRight": {
                "type": "string",
                "description": "variable expression that follows dot notiation to walk the msg structure. Array elements are referred to by their integer index"
              },
              "valLeft": {
                "description": "value literal value"
              },
              "valRight": {
                "description": "value literal value"
              },
              "op": {
                "description": "operator to compare the two variables or values. d>, d< etc. are for date comparisons. 'in' is another special operator that assumes the right side is an array and matches the value on the left in it",
                "type": {
                  "enum": [
                    "=",
                    "!=",
                    ">=",
                    ">",
                    "<",
                    "<=",
                    "d>",
                    "d<",
                    "d>=",
                    "d<=",
                    "in"
                  ]
                }
              }
            }
          },
          "receiver": {
            "type": "object",
            "description": "object that receives the messaghes sent by publisher. This is a service/servicefunction or a url implementing a post method",
            "oneOf": [
              {
                "required": [
                  "subscriber",
                  "service",
                  "servicepath"
                ]
              },
              {
                "required": [
                  "subscriber",
                  "url"
                ]
              }
            ],
            "properties": {
              "subscriber": {
                "description": "name for the subscriber",
                "type": "string"
              },
              "url": {
                "description": "fully qualified url",
                "type": "string"
              },
              "appserviceconfig": {
                "type": "string",
                "description": "appserviceconfig file path. Can be absolute or relative to the app dir"
              },
              "service": {
                "description": "cirrus installed service name",
                "type": "string"
              },
              "servicepath": {
                "description": "In the cirrus service, url of the specific route e.g. plan/task/add is this route path in workflow service",
                "type": "string"
              },
              "sysservice": {
                "description": "Indicates to the workflow that the service is to be located only in the system services. If false or not present, it will look in appservices first and then system services",
                "type": "boolean"
              },
              "security": {
                "description": "Applicable only in case of url based task. It can be accesskey which use hmac encryption or basic which is simply base64 encoding of the keys. If the url is secured by accesskey and secretkey, the type of security also needs to be specified",
                "type": {
                  "enum": [
                    "appkey",
                    "accesskey",
                    "basic",
                    "jwt"
                  ]
                }
              },
              "headers": {
                "description": "array of optional http header values that can be passed at the time of invoking the task",
                "type": "object",
                "patternProperties": {
                  "^[A-Za-z][A-Za-z0-9-_]*$": {
                    "type": "string"
                  }
                }
              },
              "appkey": {
                "description": "appkey needed to access the service if security is set to appkey. If it's a url you have to encode and pass the appkey in the header",
                "type": "string"
              },
              "acckey": {
                "description": "access key portion of security credentials",
                "type": "string"
              },
              "secretna": {
                "description": "secret key portion of security credentials",
                "type": "string"
              },
              "jwttoken": {
                "description": "the jwt token value",
                "type": "string"
              }
            }
          }
        }
      },
      "examples": [
        {
          "param": "/subscribers",
          "payload": {
            "queuename": "abced197e0kfa",
            "expression": "message.*.price>5000",
            "receiver": {
              "subscriber": "one",
              "url": "https://localhost:8080/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "queuename": "abced197e0kfa",
            "receiver": {
              "subscriber": "two",
              "appserviceconfig": "./appserviceconfig.json",
              "url": "https://localhost:8080/microservicea/v1/salesorders",
              "service1": "microservicea",
              "servicepath1": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "queuename": "secondqueue",
            "expr": {
              "varLeft": "message.body.0.model",
              "op": "=",
              "valRight": "911"
            },
            "receiver": {
              "appserviceconfig": "./appserviceconfig.json",
              "subscriber": "three-one",
              "url": "https://localhost:8080/microservicea/v1/salesorders",
              "service1": "microservicea",
              "servicepath1": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "queuename": "secondqueue",
            "expr": {
              "varLeft": "message.body.1.price",
              "op": ">",
              "valRight": 50000
            },
            "receiver": {
              "appserviceconfig": "./appserviceconfig.json",
              "subscriber": "three-two",
              "url": "https://localhost:8080/microservicea/v1/salesorders",
              "service1": "microservicea",
              "servicepath1": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "queuename": "secondqueue",
            "expr": {
              "varLeft": "message.body.0.date",
              "op": "d>",
              "valRight": "Apr 2, 2020"
            },
            "receiver": {
              "appserviceconfig": "./appserviceconfig.json",
              "subscriber": "three-three",
              "url": "https://localhost:8080/microservicea/v1/salesorders",
              "service1": "microservicea",
              "servicepath1": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "queuename": "thirdqueue",
            "expr": {
              "valLeft": "BMW",
              "op": "in",
              "varRight": "message.models"
            },
            "receiver": {
              "appserviceconfig": "./appserviceconfig.json",
              "subscriber": "three-four",
              "url": "https://localhost:8080/microservicea/v1/salesorders",
              "service1": "microservicea",
              "servicepath1": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "exchange": "exch1",
            "topics": [
              "topic11",
              "topic12"
            ],
            "receiver": {
              "subscriber": "four",
              "appserviceconfig": "./appserviceconfig.json",
              "service": "microservicea",
              "servicepath": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "exchange": "exch1",
            "topics": [
              "topic12"
            ],
            "receiver": {
              "subscriber": "five",
              "appserviceconfig": "./appserviceconfig.json",
              "service": "microservicea",
              "servicepath": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "exchange": "exch2",
            "topics": [
              "topic21",
              "topic22"
            ],
            "receiver": {
              "subscriber": "six",
              "appserviceconfig": "./appserviceconfig.json",
              "service": "microservicea",
              "servicepath": "/microservicea/v1/salesorders"
            }
          }
        },
        {
          "param": "/subscribers",
          "payload": {
            "exchange": "exch2",
            "topics": [
              "topic22"
            ],
            "receiver": {
              "subscriber": "seven",
              "appserviceconfig": "./appserviceconfig.json",
              "service": "microservicea",
              "servicepath": "/microservicea/v1/salesorders"
            }
          }
        }
      ]
    },
    {
      "route": "/subscribers",
      "type": "delete",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "DeleteSubscribers",
      "description": "Delete all the subscriptions. This is a dangerous route. Please observe extreme caution when you do this",
      "examples": [
        {
          "param": "/subscribers"
        }
      ]
    },
    {
      "route": "/subscribers/:subscriber",
      "type": "get",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "GetSubscriber",
      "description": "Get Specific subscriber information",
      "examples": [
        {
          "param": "/subscribers/one"
        },
        {
          "param": "/subscribers/two"
        },
        {
          "param": "/subscribers/three"
        }
      ]
    },
    {
      "route": "/subscribers/:subscriber",
      "type": "delete",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "DeleteSubscriber",
      "description": "Delete Specific subscriber",
      "examples": [
        {
          "param": "/subscribers/one"
        },
        {
          "param": "/subscribers/two"
        },
        {
          "param": "/subscribers/three"
        }
      ]
    },
    {
      "route": "/admin/channels",
      "type": "get",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "GetChannels",
      "description": "Get RabbitMq channels",
      "examples": [
        {
          "param": "/admin/channels"
        }
      ]
    },
    {
      "route": "/admin/exchanges",
      "type": "get",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "GetExchanges",
      "description": "Get RabbitMq exchanges",
      "examples": [
        {
          "param": "/admin/exchanges"
        }
      ]
    },
    {
      "route": "/admin/queues",
      "type": "get",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "GetQueues",
      "description": "Get RabbitMq queues",
      "examples": [
        {
          "param": "/admin/queues"
        }
      ]
    },
    {
      "route": "/admin/queues",
      "type": "delete",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "DeleteQueues",
      "description": "Get RabbitMq queues",
      "examples": [
        {
          "param": "/admin/queues"
        }
      ]
    },
    {
      "route": "/admin/connections",
      "type": "delete",
      "configured": true,
      "routeclass": "rmq.js",
      "routefunction": "DeleteConnections",
      "description": "Get RabbitMq connections",
      "examples": [
        {
          "param": "/admin/connections"
        }
      ]
    }

  ]
}