Set thread priorities.

Add retry http logic.