java.lang.Object
org.apache.activemq.artemis.spi.core.remoting.AbstractConnector
org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnector
All Implemented Interfaces:
Connector

public class NettyConnector extends AbstractConnector
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getChannelGroup

      public io.netty.channel.group.ChannelGroup getChannelGroup()
    • isServerConnection

      public boolean isServerConnection()
    • start

      public void start()
    • close

      public void close()
    • isStarted

      public boolean isStarted()
    • createConnection

      public Connection createConnection()
      Description copied from interface: Connector
      Create and return a connection from this connector.

      This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in this case it MUST return null

      Returns:
      The connection, or null if unable to create a connection (e.g. network is unavailable)
    • createConnection

      public final Connection createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect)
      Create and return a connection from this connector.

      This method must NOT throw an exception if it fails to create the connection (e.g. network is not available), in this case it MUST return null.

      This version can be used for testing purposes.

      Parameters:
      onConnect - a callback that would be called right after Bootstrap.connect()
      Returns:
      The connection, or null if unable to create a connection (e.g. network is unavailable)
    • createConnection

      public NettyConnection createConnection(Consumer<io.netty.channel.ChannelFuture> onConnect, String host, int port)
    • getConnectTimeoutMillis

      public int getConnectTimeoutMillis()
    • setConnectTimeoutMillis

      public void setConnectTimeoutMillis(int connectTimeoutMillis)
    • isEquivalent

      public boolean isEquivalent(Map<String,Object> configuration)
      Description copied from interface: Connector
      If the configuration is equivalent to this connector, which means if the parameter configuration is used to create a connection to a target node, it will be the same node as of the connections made with this connector.
      Returns:
      true means the configuration is equivalent to the connector. false otherwise
    • getBootStrap

      public io.netty.bootstrap.Bootstrap getBootStrap()
    • clearThreadPools

      public static void clearThreadPools()
    • createExpectedResponse

      public static String createExpectedResponse(String magicNumber, String secretKey) throws IOException
      Throws:
      IOException