File Release Notes and Changelog
Notes:
A few new features added in this release:
*Override the file naming date suffix on storage files to allow daily, weekly
and custom resets of MsgSeqNum In/Out.
*Change the path where storage files are located.
*Control the message timeout on response like Login/Logout.
This release has 5 bug fixes. See the change log for more details.
Changes:
-New feature to control of the MessageCacheFlatFile file name date suffix when calling Open. I was
connecting with a service that did weekly resets of MsgSeqNum and needed a way to use the
same data files for a week instead of the default behavior of reseting daily.
*Add a new interface MessageCache.FlatFile.IFileDateFormat. You can implement this interface
to control the file names date suffix. The MessageCacheFlatFile.Open uses an implementing
class to control the file name.
*Add a new class MessageCache.FlatFile.FileDateFormat. This is were I moved the default
behavior to generate new file date suffix daily.
*Add a new class MessageCache.FlatFile.FileDateFormatWeekly. Implements IFileDateFormat to
generate weekly file date suffix. When passed a date between Saturday-Sunday it
generates the same file date suffix of {StartDate:YYYYMMDD}_{EndDate:YYYYMMDD}.
-New feature to control the MessageCacheFlatFile storage path for data and index files. Set the Path
property before Open is called and it will put the files in that location.
-Add new interface IMessageCacheFactory. When a IEngine creates the IMessageCache it will
use an implementing class. This allows classes like MessageCacheFlatFile to have some new
properties set when the SocketEngine creates an instance of the cache.
-Add new class MessageCache.FlatFile.MessageCacheFlatFileFactory that implements IMessageCacheFactory.
The factory lets you set properties specific to MessageCacheFlatFile that engines need to
use when creating the IMesssageCache object. It has properties to control Path and FileDateFormat.
-Update to IEngine interface!!! The Initialize method has been shortened and some of the parameters
have been moved to properties. It was getting silly to pass all this stuff as parameters and
seems to make more sense to just use properties.
*Get/Set property for MessageCacheFactory. Instead of passing the Type for a IMessageCache
you give it a implementing IMessageCachFactory.
*Set property for MessageFactory. Since it was removed from Initialize this is where the
implementing class can set it. The Get method already existed.
-Update SocketEngine class to support IEngine changes.
*Get/Set property for MessageCacheFactory. Set this property before calling Initialize.
The engine will use this object to create any IMessageCache object instance to
store the IMessage objects.
*Set property for MessageFactory. Set this property before calling Intialize.
*Intialize has been updated to check for required properties like MessageCacheFactory and
MessageFactory have been set to some reference.
-Add SocketEngine MessageTimeout property. The engine had an internal variable to control how long
it would wait for response on Logon/Logout. The default was 5 seconds and int some cases you
may need to control this manually. The variable is now exposed as a property.
-SocketEngine.Send has been made virtual so you can override it when inheriting. I needed to do this
for unit testing but I'm sure it will be useful in other ways.
-Fix a SocketEngine resend bug that updated OrigSendingTime with the wrong value on resends. The
messages original SendingTime will now be correctly put into OrigSendingTime for resends.
-Fix a SocketEngine resend bug that would issue a resend request for every message received out of
sequence. If you received a batch of 10 messages out of sequence the engine would issue 10
resend requests. The resend should only be sent once for the batch. It checks to make sure
the resend is for a different sequence of messages or the heartbeat interval has passed.
-Fix a SocketEngine EOD bug that would cause the new day to never begin. The engine was not updating
the boolean with the correct value after it ran which made it continuously run.
-Fix a bug in MessageCacheFlatFile.Dispose that would cause null reference exception. Also made
the Close method a little more safe incase it called after Dispose.
-Fix a bunch of bugs in MessageCacheFlatFile.RecoverLog which is used to regenerate the index file
when missing. When the index file is missing it trys to generate a new one from the data file.
While regenerating the index file I found several bugs.