Interface NodeLocator<T>

Type Parameters:
T - the client type.
All Known Implementing Classes:
RestTemplateNodeLocator, WebFluxNodeLocator

public interface NodeLocator<T>
Used to obtain a connection factory for the queue leader.
Since:
2.4.8
Author:
Gary Russell
  • Field Details

  • Method Details

    • locate

      @Nullable default ConnectionFactory locate(String[] adminUris, Map<String,String> nodeToAddress, String vhost, String username, String password, String queue, FactoryFinder factoryFunction)
      Return a connection factory for the leader node for the queue.
      Parameters:
      adminUris - an array of admin URIs.
      nodeToAddress - a map of node names to node addresses (AMQP).
      vhost - the vhost.
      username - the user name.
      password - the password.
      queue - the queue name.
      factoryFunction - an internal function to find or create the factory.
      Returns:
      a connection factory, if the leader node was found; null otherwise.
    • createClient

      T createClient(String userName, String password)
      Create a client for subsequent use.
      Parameters:
      userName - the user name.
      password - the password.
      Returns:
      the client.
    • close

      default void close(T client)
      Close the client.
      Parameters:
      client - the client.
    • restCall

      @Nullable Map<String,Object> restCall(T client, String baseUri, String vhost, String queue) throws URISyntaxException
      Retrieve a map of queue properties using the RabbitMQ Management REST API.
      Parameters:
      client - the client.
      baseUri - the base uri.
      vhost - the virtual host.
      queue - the queue name.
      Returns:
      the map of queue properties.
      Throws:
      URISyntaxException - if the syntax is bad.