Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Short description around RabbitMQ usage in Digizuite. Important is to mention that you only want to change the RabbitMQ configuration if the customer specifically asks for it. 

RabbitMQ documentation: https://www.rabbitmq.com/documentation.html

NServiceBus RabbitMQ docs: https://docs.particular.net/transports/rabbitmq/

Details about Digizuite usage:

  1. RabbitMQ is multi-tenant and can be structured in a concept called Virtual Hosts (https://www.rabbitmq.com/vhosts.html).

  2. Digizuite utilize the Virtual Host concept to separate queues, exchanges and bindings between systems (this allows you to utilize an existing rabbit queue as an example so that systems on the same server can be separated on the same server and with a vhost in RabbitMQ for each of them systems).

    In the local Rabbit Management studio you can see all virtual hosts like this (localhost:15672):

    Image Modified

  3. For each vhost, we do create a publish queue and a number of subscription queues (right now there is a sub queue for DC and one for all other services such as audit and ai).

    Image Modified

  4. To exchange messages between the queues we use the conventional routing topology as per NServiceBus (https://docs.particular.net/transports/rabbitmq/routing-topology) rather than the Direct Routing with routing keys as I originally preferred. The reason is that conventional routing takes into consideration the inheritance aspect and therefore generating all exchanges for all interfaces as illustrated below:
    Image Modified


Configuration

In almost all cases you won't have to do any configuration for RabbitMQ. The Digizuite installer will automatically install RabbitMQ and start it up on http://localhost:15672. This is default (connection string format: host=localhost;username=user;password=password;virtualhost=uniqueDbName).

...

Wiki Markup
$uniqueDbName = $local:DamDatabaseRef.Substring($local:DamDatabaseRef.LastIndexOf('.') + 1);
    $ContainsDam = $uniqueDbName.EndsWith("_dam", "CurrentCultureIgnoreCase")
	if($ContainsDam) {
		    $uniqueDbName = $uniqueDbName.Substring(0, $uniqueDbName.Length - 4) 
	}


Furthermore, setting the right user privileges for that vhost is also crucial. As an examle, you would need to do the two following steps to create a vhost and set privileges with the RabbitMQ CLI:
rabbitmqctl.bat add_vhost $uniqueDbName 
rabbitmqctl.bat set_permissions -p $uniqueDbName guest ".*" ".*" ".*"


Next step would then be to construct and provide your host connection string for rabbit to the Digizuite DAM Center and Digizuite Core Services

  1. A configurable rabbitmq connection string. Format is: host=localhost;username=guest;password=guest;virtualhost=uniqueDbName
  2. This must be set in two places
    1. DAM Center app settings in web.config.

      <appSettings>
            <add key="rabbitMqConnectionString" value="host=localhost;username=guest;password=guest;virtualhost=uniqueDbName" />
            ......
      </appSettings>

    2. Digizuite Core services appsettings.json (DC Path/DigizuiteCore/appsettings.json): 

      "RabbitMQ": {        
           "ConnectionString": "host=localhost;username=user;password=password;virtualhost=uniqueDbName"
      }