Class ReactorNetty2ResourceFactory

java.lang.Object
org.springframework.http.client.reactive.ReactorNetty2ResourceFactory
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

@Deprecated(since="6.2.18", forRemoval=true) public class ReactorNetty2ResourceFactory extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Deprecated, for removal: This API element is subject to removal in a future version.
as of 6.2.18 with no replacement
Factory to manage Reactor Netty resources, i.e. LoopResources for event loop threads, and ConnectionProvider for the connection pool, within the lifecycle of a Spring ApplicationContext.

This factory implements InitializingBean and DisposableBean and is expected typically to be declared as a Spring-managed bean.

This class is based on ReactorResourceFactory.

Since:
6.0
Author:
Violeta Georgieva
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGlobalResourcesConsumer(Consumer<reactor.netty5.http.HttpResources> consumer)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Add a Consumer for configuring the global Reactor Netty resources on startup.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    reactor.netty5.resources.ConnectionProvider
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the configured ConnectionProvider.
    reactor.netty5.resources.LoopResources
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the configured LoopResources.
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Whether this factory exposes the global HttpResources holder.
    void
    setConnectionProvider(reactor.netty5.resources.ConnectionProvider connectionProvider)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use this when you want to provide an externally managed ConnectionProvider instance.
    void
    setConnectionProviderSupplier(Supplier<reactor.netty5.resources.ConnectionProvider> supplier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use this when you don't want to participate in global resources and you want to customize the creation of the managed ConnectionProvider.
    void
    setLoopResources(reactor.netty5.resources.LoopResources loopResources)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use this option when you want to provide an externally managed LoopResources instance.
    void
    setLoopResourcesSupplier(Supplier<reactor.netty5.resources.LoopResources> supplier)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use this when you don't want to participate in global resources and you want to customize the creation of the managed LoopResources.
    void
    setShutdownQuietPeriod(Duration shutdownQuietPeriod)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Configure the amount of time we'll wait before shutting down resources.
    void
    setShutdownTimeout(Duration shutdownTimeout)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Configure the maximum amount of time to wait until the disposal of the underlying resources regardless if a task was submitted during the shutdownQuietPeriod.
    void
    setUseGlobalResources(boolean useGlobalResources)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Whether to use global Reactor Netty resources via HttpResources.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ReactorNetty2ResourceFactory

      public ReactorNetty2ResourceFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setUseGlobalResources

      public void setUseGlobalResources(boolean useGlobalResources)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Whether to use global Reactor Netty resources via HttpResources.

      Default is "true" in which case this factory initializes and stops the global Reactor Netty resources within Spring's ApplicationContext lifecycle. If set to "false" the factory manages its resources independent of the global ones.

      Parameters:
      useGlobalResources - whether to expose and manage the global resources
      See Also:
    • isUseGlobalResources

      public boolean isUseGlobalResources()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Whether this factory exposes the global HttpResources holder.
    • addGlobalResourcesConsumer

      public void addGlobalResourcesConsumer(Consumer<reactor.netty5.http.HttpResources> consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Add a Consumer for configuring the global Reactor Netty resources on startup. When this option is used, setUseGlobalResources(boolean) is also enabled.
      Parameters:
      consumer - the consumer to apply
      See Also:
    • setConnectionProviderSupplier

      public void setConnectionProviderSupplier(Supplier<reactor.netty5.resources.ConnectionProvider> supplier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use this when you don't want to participate in global resources and you want to customize the creation of the managed ConnectionProvider.

      By default, ConnectionProvider.elastic("http") is used.

      Note that this supplier is ignored if isUseGlobalResources() is true or once the ConnectionProvider is set.

      Parameters:
      supplier - the supplier to use
    • setConnectionProvider

      public void setConnectionProvider(reactor.netty5.resources.ConnectionProvider connectionProvider)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use this when you want to provide an externally managed ConnectionProvider instance.
      Parameters:
      connectionProvider - the connection provider to use as is
    • getConnectionProvider

      public reactor.netty5.resources.ConnectionProvider getConnectionProvider()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the configured ConnectionProvider.
    • setLoopResourcesSupplier

      public void setLoopResourcesSupplier(Supplier<reactor.netty5.resources.LoopResources> supplier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use this when you don't want to participate in global resources and you want to customize the creation of the managed LoopResources.

      By default, LoopResources.create("webflux-http") is used.

      Note that this supplier is ignored if isUseGlobalResources() is true or once the LoopResources is set.

      Parameters:
      supplier - the supplier to use
    • setLoopResources

      public void setLoopResources(reactor.netty5.resources.LoopResources loopResources)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use this option when you want to provide an externally managed LoopResources instance.
      Parameters:
      loopResources - the loop resources to use as is
    • getLoopResources

      public reactor.netty5.resources.LoopResources getLoopResources()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the configured LoopResources.
    • setShutdownQuietPeriod

      public void setShutdownQuietPeriod(Duration shutdownQuietPeriod)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Configure the amount of time we'll wait before shutting down resources. If a task is submitted during the shutdownQuietPeriod, it is guaranteed to be accepted and the shutdownQuietPeriod will start over.

      By default, this is set to LoopResources.DEFAULT_SHUTDOWN_QUIET_PERIOD which is 2 seconds but can also be overridden with the system property ReactorNetty.SHUTDOWN_QUIET_PERIOD.

      See Also:
    • setShutdownTimeout

      public void setShutdownTimeout(Duration shutdownTimeout)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Configure the maximum amount of time to wait until the disposal of the underlying resources regardless if a task was submitted during the shutdownQuietPeriod.

      By default, this is set to LoopResources.DEFAULT_SHUTDOWN_TIMEOUT which is 15 seconds but can also be overridden with the system property ReactorNetty.SHUTDOWN_TIMEOUT.

      See Also:
    • afterPropertiesSet

      public void afterPropertiesSet()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • destroy

      public void destroy()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean