Skip to content

Resolve logging queue path

This is a small configuration helper for callers that need a direct-format MSMQ queue path but do not open or use a queue themselves. It lazily loads the server and queue-name settings, substitutes hard-coded defaults whenever configuration is missing or empty, and returns the formatted path string without performing any queue I/O.

Field Value
Operation ID LOG-OP-007
Trigger Caller invokes clsLoggingQueues.GetQueueName().
Inputs None directly; reads QueueServer and QueueName from AppSettings on demand.
Outputs FormatName:DIRECT=OS:{server}\{queue} string.
Primary components clsLoggingQueues.QueueServer, clsLoggingQueues.QueueName, clsLoggingQueues.GetQueueName
Entry point SAIF.Framework.Logging/clsLoggingQueues.vb

Steps

  1. Resolve QueueServer through its lazy property.
  2. If the cached m_QServer field is empty, read ConfigurationManager.AppSettings.Item("QueueServer").
  3. If the retrieved value is empty, substitute the hard-coded default MQPROD (BR-007).
  4. Resolve QueueName through the same pattern.
  5. If the cached m_QName field is empty, read ConfigurationManager.AppSettings.Item("QueueName").
  6. If the retrieved value is empty, substitute the hard-coded default logging (BR-007).
  7. Return String.Format("FormatName:DIRECT=OS:{0}\{1}", QueueServer, QueueName) using the resolved values (BR-007).

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([GetQueueName request]) --> Server[Resolve QueueServer or default]
    Server --> Queue[Resolve QueueName or default]
    Queue --> Format[Format direct queue path]
    Format --> End([Return queue string])

Failure and edge-case behavior

  • Server and queue-name values are cached after the first resolution, so subsequent changes to AppSettings are not picked up until the process restarts.
  • Missing or empty configuration falls back to MQPROD and logging rather than failing the caller, guaranteeing a usable path string in every case (BR-007).
  • The operation returns only a formatted string; it never verifies that the target queue actually exists or is reachable.

Sources

  • SAIF.Framework.Logging/clsLoggingQueues.vb