SitecoreDXG Documention
  • SitecoreDXG: The Documentation Experience Generator
  • Overview
    • SitecoreDXG: The Documentation Experience Generator
    • Comparison with SitecoreUML
    • CI/CD Integration
    • Helix Dependency Validation
  • Getting Started
    • Compatibility and System Requirements
    • Installing SitecoreDXG
      • General Installation
        • 1. Install the SitecoreDXG Generation Service
        • 2. Install RabbitMQ
        • 3. Install the SitecoreUML Service for Sitecore
        • 4. (Optional) Configure the Documentation Configuration Item for your Solution
        • 5. Install the Default RabbitMQ Middleman in a Custom Location
        • 6. (Optional) Integrate SitecoreDXG into your CI/CD Pipeline
      • Developer Installation
        • 1. Install the SitecoreDXG Generation Service for Developers
        • 2. Install RabbitMQ for Developers
        • 3. Install the SitecoreUML Service for Sitecore for Developers
        • 4. (Optional) Configure the Documentation Configuration Item for your Solution
        • 5. (Optional) Install the Default RabbitMQ Middleman for Developers
        • 6. (Optional) Integrate SitecoreDXG into your CI/CD Pipeline for Developers
    • Upgrading and Downgrading
    • Downloads
    • Using SitecoreDXG
      • Using the Default RabbitMQ Middleman and Trigger
        • Using the DocumentationConfiguration Object
      • Using the Provided AWS S3 Deploy Completion Handler
      • Using the Provided Azure Blob Storage Deploy Completion Handler
  • Architecture
    • Architecture Overview
    • Roles
      • Role Combinations
    • Components
    • Plugins
      • Trigger Plugins
      • Completion Handler Plugins
    • Middlemen
    • Understanding the Default RabbitMQ Middleman and Trigger
  • How To
    • CI/CD Integration
      • Integrating SitecoreDXG into your CI/CD Pipeline
      • Integrating the Default TeamCity RabbitMQ Meta-Runner
    • Creating a Custom Trigger
      • Executing Documentation Generation
      • Executing Meta-Data JSON Generation
    • Slack and Microsoft Teams Integration
      • Integrating with Slack via Webhooks
      • Integrating with Microsoft Teams via Webhooks
    • Creating a Custom Completion Handler
    • Creating a Custom Middleman
    • Viewing Helix Validation Errors
  • About the Generated Documentation
    • Overview
    • Models
      • Template Model
      • Template Field Model
      • Template Folder Model
      • Parent-Child Relationships of Models
      • Inheritance Relationship Model
      • Dependency Relationship Model
    • Views
      • Template View
      • Template Field View
      • Template Folder View
      • Parent-Child Relationship View
      • Inheritance Relationship View
      • Dependency Relationship View
    • Diagrams
      • SitecoreUML Syntax
      • Templates Diagram
      • Template Folders Diagram
      • Layer Diagrams
      • Module Diagrams
      • Module Templates Diagrams
    • Samples
Powered by GitBook
On this page
  1. Getting Started
  2. Using SitecoreDXG

Using the Default RabbitMQ Middleman and Trigger

The RabbitMQ Middleman can be called from any location using the following command-line syntax:

node rabbitmq-amqp-middleman CONNECTION_STRING ARCHITECURE_GET_URL GENERATION_QUEUE_NAME [OPTIONS_FILE_PATH]

The middleman's parameters are as follows:

  • CONNECTION_STRING: the RabbitMQ connection string to connect to

  • ARCHITECTURE_GET_URL: the URL to get the serialized template architecture from

  • GENERATION_QUEUE_NAME: the name of the generation queue to add the serialized response to

  • OPTIONS_FILE_PATH: (optional) Path to a JSON file that contains an object that may include a documentation configuration object property and/or completion handlers array property with objects representing the handler ID and parameters for each handler that should be used; For example:

SampleOptions.json
{
    "DocumentationConfiguration": {
        "CommitAuthor": "Zachary Kniebel",
        "CommitHash": "0FE1D344",
        "CommitLink": "http://mygit.com/repo/myrepo/commits/0FE1D344",
        "DeployLink": "http://mydocs.com/foo/bar"
    },
    "CompletionHandlers": [
        {
            "ID": "MyHandler1",
            "Params": {
                "foo": "bar"
            }
        },
        {
            "ID": "MyHandler2"
        }
    ]
} 

The following examples show how you can call the RabbitMQ middleman on a Habitat instance with the SitecoreUML Service (1.3.6+) installed:

To retrieve the architecture and add the result to the documentation queue for generation...

node rabbitmq-amqp-middleman amqp://localhost http://local.habitat.com/sitecoreuml/sitecoredxg/GetTemplateArchitecture "generation_queue__documentation"

To retrieve the architecture and add the result to the metadata-json queue for generation...

node rabbitmq-amqp-middleman amqp://localhost http://local.habitat.com/sitecoreuml/sitecoredxg/GetTemplateArchitecture "generation_queue__mdj"

To retrieve the architecture and add the result to the documentation queue for generation and will tell the Generation Service to call a completion handler named "helloWorld" when finished...

hello-world-sample.json
{"CompletionHandlers":[
    {
        "ID":"helloWorld"
    }]
}
node rabbitmq-amqp-middleman amqp://localhost http://local.habitat.com/sitecoreuml/sitecoredxg/GetTemplateArchitecture "generation_queue__documentation" "./hello-world-sample.json"

To retrieve the architecture and add the result to the documentation queue for generation and will tell the Generation Service to call the "MyHandler1" completion handler with a parameters object; and then the "MyHandler2" completion handler with no parameters when finished...

handlers-1-2-sample.json
{
    "CompletionHandlers": [
        {
            "ID": "MyHandler1",
            "Params": {
                "Count": 1,
                "Max": 2,
                "Hello": "world!",
                "Foo": [ "bar", "baz", 12345 ]
            }
        },
        {
            "ID": "MyHandler2"
        }
    ]
}
node rabbitmq-amqp-middleman amqp://localhost http://local.habitat.com/sitecoreuml/sitecoredxg/GetTemplateArchitecture "generation_queue__documentation" "./handlers-1-2-sample.json"
PreviousUsing SitecoreDXGNextUsing the DocumentationConfiguration Object

Last updated 6 years ago