Fix non-short-circuit-logic
Made static string final
Removed sync on queue on offer
Removed storing of context as it's never used
Moved locks to outside try block
Make inner class static
Effort to close streams on errors
Added stream closures
Removed unused rest template and closed streams
Removed unrequited call to get resource
Removed redundant synchronised block on queue
Change static count to protected