Class DialogueClients

java.lang.Object
com.palantir.dialogue.clients.DialogueClients

public final class DialogueClients extends Object
The DialogueClients.ReloadingFactory abstraction allows users to declaratively construct clients for any of the services named in the given ServicesConfigBlock. Client behaviour can be customized using the fluent methods from ConjureClients.WithClientOptions or DialogueClients.WithDialogueOptions. Users may also choose to create one-off non-live reloading clients. For maximum performance, we take great care to re-use underlying Apache connection pools as this avoids unnecessary TLS handshakes. To achieve this, it is recommended to call
invalid reference
ReloadingFactory#create
once for the lifetime of a JVM. There is no need to manually close clients or connection pools, this will be done automatically. Libraries may depend on interfaces contained in this class and/or interfaces from conjure-java-runtime's ConjureClients. All other classes in this package are considered package-private implementation details and are subject to change.
  • Method Details

    • create

      public static DialogueClients.ReloadingFactory create(com.palantir.refreshable.Refreshable<com.palantir.conjure.java.api.config.service.ServicesConfigBlock> scb)
    • create

      public static <T> T create(Class<T> clientInterface, com.palantir.conjure.java.client.config.ClientConfiguration clientConfiguration)
      Prefer create(Refreshable). Using a configured DialogueClients.ReloadingFactory should always be preferred over this method, it only exists to ease migration. Construct an instance of the given clientInterface which can be used to make network calls to the single conceptual upstream identified by clientConfiguration. Behaviour is undefined if clientConfiguration contains no URIs.
      Parameters:
      clientInterface - Dialogue client interface annotated with DialogueService
      clientConfiguration - Configuration which must contain a user-agent