11

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.

Community
  • 1
  • 1
Ben Doom
  • 7,865
  • 1
  • 27
  • 30

1 Answers1

18

Yes there is.

<cfset sFactory = CreateObject("java","coldfusion.server.ServiceFactory")>
<cfset MailSpoolService = sFactory.mailSpoolService>
<cfset MailSpoolService.stop()>
<cfset MailSpoolService.start()>
Ryan Stille
  • 1,364
  • 1
  • 13
  • 19
  • Just out of curiosity, does this work in both cases: Using the CF Mail queue, as well as mail spooling? – Adam Tuttle Sep 19 '08 at 01:53
  • This is very useful. I just wrote a script today that checks the spool because our cfmail queues are hanging intermittently as well. – Cade Sep 19 '08 at 02:53
  • Nice... that one is getting saved for future hacking... further proving the mantra "When CF fails, just have Java to do it directly." – OhkaBaka Oct 25 '09 at 17:19
  • Unless Adobe's policy has changed, using the ServiceFactory is unsupported and may break on future versions. – ale Sep 25 '08 at 15:15