Interface GridTcpRouter

  • All Known Implementing Classes:
    GridTcpRouterImpl

    public interface GridTcpRouter
    TCP router interface.

    Router allows remote clients to connect to grid without direct access to the network where grid is running. It accepts requests on the same protocol as grid rest server and establish required connection to grid nodes to serve them.

    Below is an example on how to start TCP router with non-default configuration.

     GridTcpRouterConfiguration cfg =
         new GridTcpRouterConfiguration();
    
     cfg.setHost("router.appdomain.com");
     cfg.setPort(11211);
    
     cfg.setServers(Arrays.asList(
         "node1.appdomain.com:11211",
         "node2.appdomain.com:11211"));
    
     GridRouterFactory.startTcpRouter(cfg);
     

    Note that clients should be specifically configured in order to use router. Please refer to GridClientConfiguration.getServers() and GridClientConfiguration.getRouters() documentation for more details.

    Instances of this interface are managed through GridRouterFactory.

    See Also:
    GridTcpRouterConfiguration