Producer thread produces messages and consumer thread consumes it.