Create one SQL/Data source client in the main thread passing in the queue. Pass the queue as well to the threadedServer, which in turn writes the data it receives into the queue. This way we have a fan-in from multiple threadedServer threads into the SQL/data source client, preventing multiple simultaneous writes.