Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting to allow message pruning to prune ERRORED messages #3030

Closed
rbeckman-nextgen opened this issue May 11, 2020 · 7 comments
Closed

Setting to allow message pruning to prune ERRORED messages #3030

rbeckman-nextgen opened this issue May 11, 2020 · 7 comments
Labels
Fix-Commited Issue fixed and will be available in milestone RS-6123 triaged
Milestone

Comments

@rbeckman-nextgen
Copy link
Collaborator

Introduced in Mirth 3.0, MIRTH-2235 changes the message pruner behavior so that it no longer prunes ERRORED messages.

We would like to have the ability to toggle, per channel, whether or not pruning will delete ERRORED messages instead of leaving them in the database.

Imported Issue. Original Details:
Jira Issue Key: MIRTH-3116
Reporter: daigoba66
Created: 2014-01-16T04:34:02.000-0800

@rbeckman-nextgen
Copy link
Collaborator Author

[http:https://www.mirthcorp.com/community/forums/showthread.php?t=14220]

Imported Comment. Original Details:
Author: narupley
Created: 2015-05-11T08:10:59.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

This is a serious issue for my shop as we have 8 boxes with perhaps 1000 channels and I really don't want to have to manually prune the old error messages. Has anyone come up with a workaround? Perhaps a SQL query that can get to the DB directly?

Imported Comment. Original Details:
Author: jtheune
Created: 2017-09-01T12:49:06.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

We created a channel that goes through the MirthDB and sets the status from ERROR to SENT after a configurable interval; Then the regular Mirth Pruner picks them up to be deleted.

Imported Comment. Original Details:
Author: bradcrawford
Created: 2017-10-31T07:02:43.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

Can you post that channel?

Imported Comment. Original Details:
Author: jtheune
Created: 2017-10-31T07:14:54.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

I can't post the entire channel because we have other proprietary items present but below is the important part. Update the DB connection info and set the 'PurgeDays' Put this into a Javascript reader and schedule it to run nightly.

var dbConn = DatabaseConnectionFactory.createDatabaseConnection(dbDriver, dbDatabase, dbUser, dbPassword);
var Query = "SELECT LOCAL_CHANNEL_ID FROM D_CHANNELS";
var result = dbConn.executeCachedQuery(Query);

while (result.next())
{
var channelID = result.getString("LOCAL_CHANNEL_ID").trim();
var Query3 = "SELECT MESSAGE_ID FROM D_MM" + channelID + " WHERE STATUS = 'E' AND DATEDIFF(d, RECEIVED_DATE, GETDATE()) > " + purgeDays;
var result2 = dbConn.executeCachedQuery(Query3);
var i = result2.size();

//LOOP UNTIL RECORD COUNT FOR TABLE IS ZERO
while ( i > 0 )
{
		//Update error messages in batches
		var Query2 = "UPDATE TOP (1000) D_MM" + channelID +  " SET STATUS = 'S' WHERE STATUS = 'E' AND DATEDIFF(d, RECEIVED_DATE, GETDATE()) > " + purgeDays;

		dbConn.executeUpdate(Query2);

		java.lang.Thread.sleep(5000);

		var result3 = dbConn.executeCachedQuery(Query3);
		i =  result3.size();
		
		result3.close();
}
result2.close();

}

result.close();
dbConn.close();

Imported Comment. Original Details:
Author: bradcrawford
Created: 2017-10-31T10:06:27.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

I would recommend the priority on this issue be raised to high. Anyone with multiple Mirth instances or many channels would find management very difficult without this being fixed. Thank You

Imported Comment. Original Details:
Author: bradcrawford
Created: 2017-10-31T10:10:45.000-0700

@rbeckman-nextgen
Copy link
Collaborator Author

Five years out and this is still should be a high priority issue. Brad come up with a good workaround, but what is the user need for an endless, perpetual accumulation of error log entries?

Imported Comment. Original Details:
Author: mbrighton
Created: 2020-03-27T08:16:08.000-0700

@cturczynskyj cturczynskyj added the closed-due-to-inactivity This is being closed due to age. If this is still an issue, comment and we can reopen. label Mar 1, 2021
@pladesma pladesma closed this as completed Mar 1, 2021
@cturczynskyj cturczynskyj added Fix-Commited Issue fixed and will be available in milestone RS-6123 triaged and removed closed-due-to-inactivity This is being closed due to age. If this is still an issue, comment and we can reopen. labels Sep 22, 2021
@cturczynskyj cturczynskyj added this to the 3.12.0 milestone Sep 22, 2021
@cturczynskyj cturczynskyj reopened this Sep 22, 2021
@pladesma pladesma closed this as completed Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix-Commited Issue fixed and will be available in milestone RS-6123 triaged
Projects
None yet
Development

No branches or pull requests

3 participants