Getting Started with Scheduled Queues
When a customer calls a plumber and states "My sink is running." The plumber is safe in the assumption that it is leaking water rather than jogging down the street. However, "My scheduled queue's are not processing" can mean many different things! Today we will take a look at scheduled queue's and a some basic ideas to help troubleshoot them.
The first thing we should do when troubleshooting a scheduled queue is ensure that the queue service has been properly installed and setup. Part of that setup is to ensure that it is installed on only one machine and preferrably one that stays turned on. Blackbaud recommends installing it on the server because it's usually left on over night and users don't usually log into the applications while physically sitting at the server. This will stop overlapping queue's from interfering with each other and causing blocks in your database. It's also a good idea when testing an issue with a scheduled queue, to start out by setting them all to "On Demand." This ensures you don't have a stack of queue's trying to run and yours isn't lost in the mix.
After you have ensured that the queue user and the scheduled queue's are setup properly, you'll want to ask yourself 2 questions:
- What is the queue service being asked to do?
- What exactly is the queue service not doing?
In this area, we need to be as specific as we can, because the answers to those two questions will direct most of your focus. If for example, if queue is setup to export a query to a folder somewhere other than locally, you will need to know if the query is being run and then if the export is being run. If the query is not actually getting done, you will want to troubleshoot the query. Whereas if the export is not completing, you will want to verify that you have access to that network location where the export is supposed to be going.
Perhaps you have a scheduled queue that is supposed to query the database, export the information to a network drive for your staff meeting tomorrow, and email the results of the scheduled queue to you. In this scenario, it is a good idea to break the queue down into it's simplist form. Create a simple queue that refreshes the query you were planning to run. If the query worked, then reschedule the queue to run the query and export to a local folder. Once that succeeds, then move the export to a shared folder somewhere else on the network. In this fashion you can keep adding steps until one fails, then troubleshoot that portion of the queue.
If the query failed, then create a new query with even simpler requests. For example, instead of querying an entire years worth of data, only query data for a 14 day period. Even simpler, create a queue that is scheduled to refresh a query. If you don't have a simple query, then create one that is designed to request a unique first or last name from the database and refresh that query.
These same steps can also be completed in the reverse order. In the same example above where you're querying, exporting and emailing results, you can try to run the query. If it fails, then remove the email function and run it again. If it fails there, then remove the export, or set it to export locally instead of on a network drive.
Many things can cause a scheduled queue to fail. You can help speed up the process of narrowing the issue down by considering the factors above. While troubleshooting scheduled queues in their entirety can be a daunting task, I hope I've given you some solid ground to start with!