Package 

Class ClientConfig


  • 
    public final class ClientConfig
    
                        

    This class is used for configuring the clients for nsq. Immutable properties must be set when creating the object and are sent to NSQ for feature specification or negotiation. Keep in mind that some features might require some configuration on the server-side and could be not available.

    • Method Detail

      • getClientId

         final String getClientId()

        An identifier used to disambiguate this client (i.e. something specific to the consumer)

      • getFeatureNegotiation

         final Boolean getFeatureNegotiation()

        Boolean used to indicate that the client supports feature negotiation. If the server is capable, it will send back a JSON payload of supported features and metadata.

      • getHeartbeatInterval

         final Integer getHeartbeatInterval()

        Milliseconds between heartbeats.

        Valid range: 1000 <= heartbeat_interval <= configured_max (-1 disables heartbeats)

      • getDeflateLevel

         final Integer getDeflateLevel()

        Configure the deflate compression level for this connection.

        Valid range: 1 <= deflate_level <= configured_max

        Higher values mean better compression but more CPU usage for nsqd.

      • getUserAgent

         final String getUserAgent()

        A string identifying the agent for this client in the spirit of HTTP.

      • getMsgTimeout

         final Integer getMsgTimeout()

        Configure the server-side message timeout in milliseconds for messages delivered to this client.

      • getSampleRate

         final Integer getSampleRate()

        The sample rate for incoming data to deliver a percentage of all messages received to this connection. This only applies to subscribing connections. The valid range is between 0 and 99, where 0 means that all data is sent (this is the default). 1 means that 1% of the data is sent.

      • getAuthSecret

         final ByteArray getAuthSecret()

        The secret used for authorization, if the server requires it. This value will be ignored if the server does not require authorization.

      • setAuthSecret

         final Unit setAuthSecret(ByteArray authSecret)

        The secret used for authorization, if the server requires it. This value will be ignored if the server does not require authorization.

      • getReadTimeout

         final Integer getReadTimeout()

        The read timeout for connection sockets and for awaiting responses from nsq.

      • setReadTimeout

         final Unit setReadTimeout(Integer readTimeout)

        The read timeout for connection sockets and for awaiting responses from nsq.