I have a python script I run that drains the beanstalk queue and inserts selected information into at MySQL database. It runs once a minute using a cron job. I am not a programmer and I am sure there are better ways to do this, but it is working well for me.
#!/usr/bin/env python
import beanstalkc
import time
import json
import MySQLdb
db = MySQLdb.connect("localhost", "root", "YOUR_MySQL_PASSWORD","alprdb")
beanstalk = beanstalkc.Connection(host='localhost', port=11300)
cur = db.cursor()
beanstalk.watch('alprd')
while True:
job = beanstalk.reserve(timeout=0)
if job is not None:
decoded= json.loads(job.body)
_plate = decoded['results'][0]['plate']
_uuid = decoded['uuid']
epoch = decoded['epoch_time']
_date = time.strftime('%Y-%m-%d',time.localtime(epoch/1000))
_time = time.strftime('%H:%M:%S',time.localtime(epoch/1000))
_location = decoded['site_id']
_camera = decoded['camera_id']
cur.execute("INSERT INTO alprdb(date, time, location, camera, plate, uuid) VALUES(%s, %s, %s, %s, %s, %s)",(_date, _time, _location, _camera, _plate, _uuid))
db.commit()
job.delete()
else:
cur.close()
db.close()
break
exit()