Custom Purge Job
I want to create an interface specific purge job. Please let me know if there are any holes in my approach. I realize that an interface that went from HospitalAService to HospitalARouter to PracticeBOperation would require two separate executes in my example below, but I want that granularity as there are some intermediate steps in our workflows that we don't need to retain messages for.
- Create a custom scheduled task that extends Ens.MessageHeader
- Overwrite the Purge function select statements
- Integrity
- Old
- DECLARE C1 CURSOR FOR
Select TOP 100000000 ID,MessageBodyId,MessageBodyClassName Into :%tID,:%tBodyId,:%tBodyClassname From Ens.MessageHeader h
Where (TimeCreated < :%tDoNotDeleteDate)
And 0 = ( Select Count(*) From Ens.MessageHeader
Where (SessionId = h.SessionId)
And (Status<>$$$eMessageStatusCompleted)
And (Status<>$$$eMessageStatusAborted)
And (Status<>$$$eMessageStatusError)
And (Status<>$$$eMessageStatusDiscarded)
Order By TimeCreated
)
- DECLARE C1 CURSOR FOR
- New
- DECLARE C1 CURSOR FOR
Select TOP 100000000 ID,MessageBodyId,MessageBodyClassName Into :%tID,:%tBodyId,:%tBodyClassname From Ens.MessageHeader h
Where SourceConfigName=:tSourceConfigName and TargetConfigName = :tTargetConfigName and (TimeCreated < :%tDoNotDeleteDate)
And 0 = ( Select Count(*) From Ens.MessageHeader
Where (SessionId = h.SessionId)
And (Status<>$$$eMessageStatusCompleted)
And (Status<>$$$eMessageStatusAborted)
And (Status<>$$$eMessageStatusError)
And (Status<>$$$eMessageStatusDiscarded)
And SourceConfigName = :tSourceConfigName
And TargetConfigName = :tTargetConfigName
- DECLARE C1 CURSOR FOR
- Old
- Integrity
Order By TimeCreated
)- No Integrity
- Old
- DECLARE C2 CURSOR FOR
Select ID,MessageBodyId,MessageBodyClassName Into :%tID,:%tBodyId,:%tBodyClassname From Ens.MessageHeader
Where SourceConfigName=:tSourceConfigName and TargetConfigName = :tTargetConfigName and (TimeCreated < :%tDoNotDeleteDate))
- DECLARE C2 CURSOR FOR
- New
- DECLARE C2 CURSOR FOR
Select ID,MessageBodyId,MessageBodyClassName Into :%tID,:%tBodyId,:%tBodyClassname From Ens.MessageHeader
Where SourceConfigName=:tSourceConfigName and TargetConfigName = :tTargetConfigName and (TimeCreated < :%tDoNotDeleteDate))
- DECLARE C2 CURSOR FOR
- Old
- No Integrity