AP&C API Reference
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Apac.Messaging.MessageController Class Reference

This class is the heart of the notification system. It delegates message transport to instances of IMessageHandler based on configuration values for each MessageType. It hosts all timing needed to check for and retry failed messages. It maintains the message queues and archives.
More...

Public Member Functions

 MessageController ()
 Creates a new message controller. More...
 
void Start ()
 Starts the message controller looking for pending notifications to deliver. More...
 
void Stop ()
 Stops the message controller looking for pending notifications to deliver. More...
 
void ServiceQueue (string queue)
 Triggers the controller to service a specific queue. This keeps the message from having to wait until the sleep cycle ends to get the message moving, and is called from the Notify method just before completion. More...
 

Static Public Member Functions

static void Notify (string queue, MessageType type, string subject, string body)
 A well-known entry point for initiating message notification, this method enqueues the incoming data as a Message and triggers processing for it.
More...
 
static void Notify (string queue, MessageType type, string subject, string body, Dictionary< string, object > propertyBag)
 A well-known entry point for initiating message notification, this method enqueues the incoming data as a Message and triggers processing for it.
More...
 
static void Configure (Messages.ConfigurationMessage msg)
 Enqueues a configuration message. More...
 

Public Attributes

MessageControllerStatusHandler MessageControllerStatus
 A simple event for reporting status from within the controller. More...
 

Protected Member Functions

virtual void OnMessageControllerStatus (string status)
 Wraps the event of the same name and allows subclasses to handle the event without wiring up a delegate. More...
 

Properties

static string WellknownSystemQueue [get]
 Gets the wellknown name (configurable) of the queue used for system status messages. More...
 
static string WellknownConfigQueue [get]
 Gets the wellknown name (configurable) of the queue used for configuration messages (which can add and remove queues). More...
 

Detailed Description

This class is the heart of the notification system. It delegates message transport to instances of IMessageHandler based on configuration values for each MessageType. It hosts all timing needed to check for and retry failed messages. It maintains the message queues and archives.

This class does not use the schduler infrastucture because

Constructor & Destructor Documentation

◆ MessageController()

Apac.Messaging.MessageController.MessageController ( )
inline

Creates a new message controller.

Member Function Documentation

◆ Configure()

static void Apac.Messaging.MessageController.Configure ( Messages.ConfigurationMessage  msg)
inlinestatic

Enqueues a configuration message.

Parameters
msgThe message to be sent.

◆ Notify() [1/2]

static void Apac.Messaging.MessageController.Notify ( string  queue,
MessageType  type,
string  subject,
string  body 
)
inlinestatic

A well-known entry point for initiating message notification, this method enqueues the incoming data as a Message and triggers processing for it.

While this is a well-known method, callers should invoke it through a delegate provided by the ServiceLocator interface. This will decouple callers from this method implementation in case it must be changed.

Parameters
queueThe isolated partition to which the message is destined. This can be thought of as a customer within a bank's domain or an enterprise within an ASP's configuration domain.
typeThe type of content in the message. See MessageType.
subjectA short summary of the message indicating its purpose.
bodyThe content of the message.

◆ Notify() [2/2]

static void Apac.Messaging.MessageController.Notify ( string  queue,
MessageType  type,
string  subject,
string  body,
Dictionary< string, object >  propertyBag 
)
inlinestatic

A well-known entry point for initiating message notification, this method enqueues the incoming data as a Message and triggers processing for it.

While this is a well-known method, callers should invoke it through a delegate provided by the ServiceLocator interface. This will decouple callers from this method implementation in case it must be changed.

Parameters
queueThe isolated partition to which the message is destined. This can be thought of as a customer within a bank's domain or an enterprise within an ASP's configuration domain.
typeThe type of content in the message. See MessageType.
subjectA short summary of the message indicating its purpose.
bodyThe content of the message.
propertyBagThe set of extended data elements to be tagged along with the message, through the messaging system. This data does not become part of the delivered message for standard message handlers. Objects in the property bag must support serialization and/or XML serialization, preferrably both. If the system is configured to serialize in a format not supported by the objects in the property bag, then they will be lost.

◆ OnMessageControllerStatus()

virtual void Apac.Messaging.MessageController.OnMessageControllerStatus ( string  status)
inlineprotectedvirtual

Wraps the event of the same name and allows subclasses to handle the event without wiring up a delegate.

Parameters
statusThe status message to report.

◆ ServiceQueue()

void Apac.Messaging.MessageController.ServiceQueue ( string  queue)
inline

Triggers the controller to service a specific queue. This keeps the message from having to wait until the sleep cycle ends to get the message moving, and is called from the Notify method just before completion.

Parameters
queueThe name of the queue to be services.

◆ Start()

void Apac.Messaging.MessageController.Start ( )
inline

Starts the message controller looking for pending notifications to deliver.

◆ Stop()

void Apac.Messaging.MessageController.Stop ( )
inline

Stops the message controller looking for pending notifications to deliver.

Member Data Documentation

◆ MessageControllerStatus

MessageControllerStatusHandler Apac.Messaging.MessageController.MessageControllerStatus

A simple event for reporting status from within the controller.

Property Documentation

◆ WellknownConfigQueue

string Apac.Messaging.MessageController.WellknownConfigQueue
staticget

Gets the wellknown name (configurable) of the queue used for configuration messages (which can add and remove queues).

◆ WellknownSystemQueue

string Apac.Messaging.MessageController.WellknownSystemQueue
staticget

Gets the wellknown name (configurable) of the queue used for system status messages.


The documentation for this class was generated from the following file: