Configuring the application to use DBQueue
Who is this article for?
IT Administrators configuring message queuing.
IT Administrator permissions are required to complete the configuration.
Ideagen Internal Audit uses the Microsoft Message Queue (MSMQ) for communication between the Robot and the main application service.
It is possible to configure the application to use a table within the database for this messaging instead. With this alternate configuration, messages left by the application service or Robot will be written to a table within the Pentana database called PENTANA_MESSAGE.
This article describes the configuration changes required, and documents common problems.
Changing the configuration to work with a database table
To implement this change, it is necessary to alter the configuration of the config for the main service and Robot service. This will cause a brief moment of downtime.
- Ensure that nobody is using the system
- At the database server, grant the Pentana Robot service user the following roles in the Pentana database: dbdatareader
dbdatawriter - At the application server, stop the Pentana Robot service
- Open App Manager, and ensure that the correct instance is loaded
- Go to the Config > Service tab, and locate the Pentana.Tng.Notification section
- Change the following values:
QueueName changes from .\private$\Pentana[instance] to PENTANA_MESSAGE
NotificationStrategy changes from MSMQ to DBQueue
Before:
After:
- Save the change
- Go to the Server Robot tab, and locate the appSettings section
- Change the following values:
MessageQueueStrategy changes from MSMQ to DBQueue
MessageQueue changes from .\private$\Pentana[instance] to PENTANA_MESSAGE - Add a new key, substituting your database server\instance and database names:
<add key="MessageQueueProviderString" value="Integrated Security=SSPI;Data Source=[SQLServerInstance];Initial Catalog=[PentanaDB]"/>
Before:
After:
- Save
- Start the Robot service
Common errors
Service does not start, with error "SqlException - Message: Cannot open database "[database name]" requested by the login"
This configuration requires that the Windows user running the Robot service is able to directly access the Pentana database, and has the dbdatareader and dbdatawriter roles. If the service does not start, and this error appears in the Robot service log:
- On the application server, open services.msc
- Locate the Robot service
- Check the user account used to run the service
- At the database, ensure that there is a login for that user, with the roles described above
- Try starting the service again
Triggering a custom business rule fails, with message "Message: String or binary data would be truncated."
Where a custom business rule causes a message to be left on the queue, you will hit this problem where the rule name is longer than 50 characters. An error like this may be logged:
1. Exception of type: Exception - Message: An error occurred during the Undo Completed workflow System.Object: [...] 1.1. Exception of type: TngException[General] - Message: The service response contained response-level errors. [...] 1.1.1. Exception of type: SqlException - Message: String or binary data would be truncated.
The options to resolve this are:
- Recreate the business rule with a shorter label, or
- Widen the column. A script to do this is attached below