views:

793

answers:

3

We are currently experiencing intermittent mail queue stoppages. I'm seeking diagnostic help in another area.

In the meantime, is there a way to restart the CF mail queue without restarting the service as a whole?

CF8 standard Win2k3

Solution: We are now checking the age of the oldest file in the mail queue. When it exceeds a set age (currently 30 min) the mail queue is restarted.

+13  A: 

Yes there is.

<cfset sFactory = CreateObject("java","coldfusion.server.ServiceFactory")>
<cfset MailSpoolService = sFactory.mailSpoolService>
<cfset MailSpoolService.stop()>
<cfset MailSpoolService.start()>
Just out of curiosity, does this work in both cases: Using the CF Mail queue, as well as mail spooling?
Adam Tuttle
This is very useful. I just wrote a script today that checks the spool because our cfmail queues are hanging intermittently as well.
Cade
Nice... that one is getting saved for future hacking... further proving the mantra "When CF fails, just have Java to do it directly."
OhkaBaka
+1  A: 

Unless Adobe's policy has changed, using the ServiceFactory is unsupported and may break on future versions.

Al Everett
A: 

Who cares - It works at the moment :-) Thanks Zirconx

Martin

ColdFusion