Search code examples
groovyhttpbuilder-ng

Is HttpBuilder in httpbuilder-ng thread safe?


I would like to configure a single instance of HttpBuilder with some standard headers in my application, and allow that instance to be used by multiple threads. Are there any issues with this?


Solution

  • Yes, HttpBuilder-NG is thread-safe. That is, the HttpBuilder instance should be created and then shared, such that the actual request method calls (e.g. get, post, etc) may be made across multiple threads.

    There are no known issues with multi-threaded usage at this time.