Aggregators

At the moment there are 2 (types of) aggregators:

Text file aggregator

This aggregator read text file (technically could be any file but it is handled as a text file) and aggregate the contents. The way if aggregates/group messages depends on several options explained later.

Embedded values

It is possible to specified the 'To' and 'Subject fields inside the text files. This is optional since the aggregator config allows you to specify default values. If specified they must look like this inside the text file:
To:someAddress@someDomain.com
Subject:Test
Some body text...

Note that the 'To:' field can be on any line (does not have to be the first line but its easier to read that way) but it must be the first characters of a line. The same applies to the 'Subject:' field.

Config

The config passed to the text file aggregator must look like this:
<source type="FlatFile" name="Some name" inputFilePath="some path" inputFileMask="*.txt" maxMsgSize="1048576" aggregatedSubject="Aggregated message" aggregateBySubject="false" removeFilesOnDone="False" appendDoneFiles="True" defaultToAddress="someAddress@someDomain.com" appendDoneFileMaxSizeKB="10" />
The following is an explanation of the config value attributes:
  • type - must be FlatFile or MailAggregatorFFSource for this aggregator
  • name - any name you want to give it
  • inputFilePath - the path where the text files are located
  • inputFileMask - the file mask/pattern
  • maxMsgSize - maximum size (bytes) an aggregated message could be before a new separate instance is created
  • aggregatedSubject - default subject
  • aggregateBySubject - specify if message must also be grouped by subject (default is only 'to' address)
  • removeFilesOnDone - delete the source file when done
  • appendDoneFiles - append the source file contents to an existing '.done' file if it already exists. Otherwise the original file is just renamed to '*.done'
  • defaultToAddress - default 'to' address
  • appendDoneFileMaxSizeKB - if the appended 'done' file exceed the specified size create a new instance and rename older files with a number before '.done' e.g. *1.done, *2.done etc.

Sql aggregator

This aggregator queries a SQL server table - using either stored proc (recommended) or plain select statement and then like the text file aggregator groups the messages and sends them. Once sent the messages are marked done with another stored proc or update statement that must accept a @Id parameter.

Config

The config for this aggregator must look like this:
<source type="SqlServer" name="" sqlServerName="" database="" integratedSec="True" userName="" password="" aggregatedSubject="" aggregateBySubject="False" defaultToAddress="" useSPs="True" selectMsgs="GetMailAggregatorMessages" markMessageDone="MarkMailAggregatorMessageAsDone" />
The following is an explanation of the config value attributes:
  • type - must be SqlServer or MailAggregatorSqlSource
  • name - any name you want to give it
  • sqlServerName - the sql server instance name
  • database - name of the database
  • integratedSec - use integrated security or not (True/False)
  • userName - if not using integrated security use this username
  • password - ditto for password
  • aggregatedSubject - default subject
  • aggregateBySubject - specify if message must also be grouped by subject (default is only 'to' address)
  • defaultToAddress - default 'to' address
  • useSPs - use stored procs (recommended) (True/False)
  • selectMsgs - name of stored proc or the select query. This query must return the following fields:
    • Id int
    • ToAddress string - could be empty e.g. ""
    • Subject string
    • Body string
  • markMessageDone - name of the stored proc or update statement that takes @Id int as parameter.

How content is aggregated

By default content is only grouped by the 'to' address (if present). Optionally the 'subject' field can also be used (again if it is supplied).

Last edited Feb 29, 2012 at 6:15 AM by RudolfHenning, version 6

Comments

No comments yet.