UNPKG

node-rdkafka-imhoff

Version:
3,681 lines (1,119 loc) • 47 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Client</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify.css"> <link type="text/css" rel="stylesheet" href="toolkit/css/toolkit/bnet-responsive.min.css"> <link type="text/css" rel="stylesheet" href="styles/main.css"> </head> <body> <!-- HEADER --> <div class="navbar-static"> <header class="navbar header"> <div class="grid-container"> <div class="grid-25"> <a class="brand mark" href="index.html"> Class: Client <span class="tag">3.6.11</span> </a> </div> <div class="grid-75"> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"><a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#" onclick="return false;">Classes</a><ul class="dropdown-menu" role="menu"><li><a href="AdminClient.html">AdminClient</a></li><li><a href="Client.html">Client</a></li><li><a href="HighLevelProducer.html">HighLevelProducer</a></li><li><a href="KafkaConsumer.html">KafkaConsumer</a></li><li><a href="KafkaConsumerStream.html">KafkaConsumerStream</a></li><li><a href="LibrdKafkaError.html">LibrdKafkaError</a></li><li><a href="Producer.html">Producer</a></li><li><a href="ProducerStream.html">ProducerStream</a></li></ul></li><li class="dropdown"><a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#" onclick="return false;">Events</a><ul class="dropdown-menu" role="menu"><li><a href="Client.html#event:disconnected">disconnected</a></li><li><a href="Client.html#event:ready">ready</a></li><li><a href="HighLevelProducer.html#event:disconnected">disconnected</a></li><li><a href="HighLevelProducer.html#event:ready">ready</a></li><li><a href="KafkaConsumer.html#event:data">data</a></li><li><a href="KafkaConsumer.html#event:disconnected">disconnected</a></li><li><a href="KafkaConsumer.html#event:ready">ready</a></li><li><a href="Producer.html#event:disconnected">disconnected</a></li><li><a href="Producer.html#event:ready">ready</a></li></ul></li><li class="dropdown"><a class="dropdown-toggle" role="button" data-toggle="dropdown" href="#" onclick="return false;">Tutorials</a><ul class="dropdown-menu" role="menu"><li><a href="tutorial-consumer-flow.html">consumer-flow</a></li><li><a href="tutorial-consumer-per-partition.html">consumer-per-partition</a></li><li><a href="tutorial-consumer.html">consumer</a></li><li><a href="tutorial-docker-alpine.html">docker-alpine</a></li><li><a href="tutorial-high-level-producer.html">high-level-producer</a></li><li><a href="tutorial-metadata.html">metadata</a></li><li><a href="tutorial-producer-cluster.html">producer-cluster</a></li><li><a href="tutorial-producer_.html">producer</a></li></ul></li><h3>Global</h3><ul><li><a href="global.html#createAdminClient">createAdminClient</a></li><li><a href="global.html#createSerializer">createSerializer</a></li><li><a href="global.html#RefCounter">RefCounter</a></li><li><a href="global.html#Topic">Topic</a></li><li><a href="global.html#TopicPartition">TopicPartition</a></li></ul> </ul> </div> </div> </header> </div> <!-- /HEADER --> <div class="body-content"> <div class="grid-container project-container"> <div class="grid-75 push-25"> <h1>Class: Client</h1> <section> <header> <h2>Client</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Client"> <span class="type-signature"></span>new Client<span class="signature">(globalConf, SubClientType, topicConf)</span><span class="type-signature"></span> </h4> <div class="description"> <p>Base class for Consumer and Producer This should not be created independently, but rather is the base class on which both producer and consumer get their common functionality.</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">globalConf</td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Global configuration in key value pairs.</td> </tr> <tr> <td class="name">SubClientType</td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">The function representing the subclient type. In C++ land this needs to be a class that inherits from Connection.</td> </tr> <tr> <td class="name">topicConf</td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Topic configuration in key value pairs</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line35">client.js, line 35</a> </li></ul> </dd> </dl> </div> <div class="clearfix"> <div class="grid-75"> <h3 class="heading-2">Extends:</h3> </div> <div class="grid-25 top-link"> <small> <a href="#top" class="inverse"> <i class="icon-chevron-up"></i> &nbsp;Back to top. </a> </small> </div> </div> <ul> <li>Emitter</li> </ul> <div class="clearfix"> <div class="grid-75"> <h3 class="heading-2">Members:</h3> </div> <div class="grid-25 top-link"> <small> <a href="#top" class="inverse"> <i class="icon-chevron-up"></i> &nbsp;Back to top. </a> </small> </div> </div> <h4 class="name" id="_metadata"><span class="type-signature"></span>_metadata<span class="type-signature"> :<a href="Client.html#~Metadata">Client~Metadata</a></span></h4> <div class="description"> <p> Metadata object. Starts out empty but will be filled with information after the initial connect. </p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="Client.html#~Metadata">Client~Metadata</a></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line101">client.js, line 101</a> </li></ul> </dd> </dl> <div class="clearfix"> <div class="grid-75"> <h3 class="heading-2">Methods:</h3> </div> <div class="grid-25 top-link"> <small> <a href="#top" class="inverse"> <i class="icon-chevron-up"></i> &nbsp;Back to top. </a> </small> </div> </div> <h4 class="name" id="connect"> <span class="type-signature"></span>connect<span class="signature">(metadataOptions, cb)</span><span class="type-signature"> &rarr; {<a href="Client.html">Client</a>}</span> </h4> <div class="description"> <p>Connect to the broker and receive its metadata. Connects to a broker by establishing the client and fetches its metadata.</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">metadataOptions</td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Options to be sent to the metadata. <h6>Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">topic</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Topic to fetch metadata for. Empty string is treated as empty.</td> </tr> <tr> <td class="name">allTopics</td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">Fetch metadata for all topics, not just the ones we know about.</td> </tr> <tr> <td class="name">timeout</td> <td class="type"> <span class="param-type">int</span> </td> <td class="description last">The timeout, in ms, to allow for fetching metadata. Defaults to 30000ms</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name">cb</td> <td class="type"> <span class="param-type"><a href="Client.html#~connectionCallback">Client~connectionCallback</a></span> </td> <td class="description last">Callback that indicates we are done connecting.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line135">client.js, line 135</a> </li></ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - Returns itself. </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="Client.html">Client</a></span> </dd> </dl> <h4 class="name" id="connectedTime"> <span class="type-signature"></span>connectedTime<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span> </h4> <div class="description"> <p>Find out how long we have been connected to Kafka.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line250">client.js, line 250</a> </li></ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - Milliseconds since the connection has been established. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> <h4 class="name" id="disconnect"> <span class="type-signature"></span>disconnect<span class="signature">()</span><span class="type-signature"> &rarr; {function}</span> </h4> <div class="description"> <p>Disconnect from the Kafka client. This method will disconnect us from Kafka unless we are already in a disconnecting state. Use this when you're done reading or producing messages on a given client. It will also emit the disconnected event.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line288">client.js, line 288</a> </li></ul> </dd> </dl> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Fires:</h4> </div> </div> <ul> <li><a href="Client.html#event:disconnected">Client#event:disconnected</a></li> </ul> <h5>Returns:</h5> <div class="param-desc"> - Callback to call when disconnection is complete. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">function</span> </dd> </dl> <h4 class="name" id="getClient"> <span class="type-signature"></span>getClient<span class="signature">()</span><span class="type-signature"> &rarr; {Connection}</span> </h4> <div class="description"> <p>Get the native Kafka client. You probably shouldn't use this, but if you want to execute methods directly on the c++ wrapper you can do it here.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line241">client.js, line 241</a> </li></ul> </dd> <dt class="tag-see">See:</dt> <dd class="tag-see"> <ul> <li>connection.cc</li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - The native Kafka client. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Connection</span> </dd> </dl> <h4 class="name" id="getLastError"> <span class="type-signature"></span>getLastError<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="LibrdKafkaError.html">LibrdKafkaError</a>}</span> </h4> <div class="description"> <p>Get the last error emitted if it exists.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line272">client.js, line 272</a> </li></ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - Returns the LibrdKafkaError or null if one hasn't been thrown. </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="LibrdKafkaError.html">LibrdKafkaError</a></span> </dd> </dl> <h4 class="name" id="getMetadata"> <span class="type-signature"></span>getMetadata<span class="signature">(metadataOptions, cb)</span><span class="type-signature"></span> </h4> <div class="description"> <p>Get client metadata. Note: using a <code>metadataOptions.topic</code> parameter has a potential side-effect. A Topic object will be created, if it did not exist yet, with default options and it will be cached by librdkafka. A subsequent call to create the topic object with specific options (e.g. <code>acks</code>) will return the previous instance and the specific options will be silently ignored. To avoid this side effect, the topic object can be created with the expected options before requesting metadata, or the metadata request can be performed for all topics (by omitting <code>metadataOptions.topic</code>).</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">metadataOptions</td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Metadata options to pass to the client. <h6>Properties</h6> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">topic</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Topic string for which to fetch metadata</td> </tr> <tr> <td class="name">timeout</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Max time, in ms, to try to fetch metadata before timing out. Defaults to 3000.</td> </tr> </tbody> </table> </td> </tr> <tr> <td class="name">cb</td> <td class="type"> <span class="param-type">Client~metadataCallback</span> </td> <td class="description last">Callback to fire with the metadata.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line340">client.js, line 340</a> </li></ul> </dd> </dl> <h4 class="name" id="isConnected"> <span class="type-signature"></span>isConnected<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span> </h4> <div class="description"> <p>Whether or not we are connected to Kafka.</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line262">client.js, line 262</a> </li></ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - Whether we are connected. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">boolean</span> </dd> </dl> <h4 class="name" id="offsetsForTimes"> <span class="type-signature"></span>offsetsForTimes<span class="signature">(toppars, timeout, cb)</span><span class="type-signature"></span> </h4> <div class="description"> <p>Query offsets for times from the broker. This function makes a call to the broker to get the offsets for times specified.</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">toppars</td> <td class="type"> <span class="param-type">Array.&lt;<a href="global.html#TopicPartition">TopicPartition</a>></span> </td> <td class="description last">Array of topic partitions. The offset in these should instead refer to a timestamp you want offsets for</td> </tr> <tr> <td class="name">timeout</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Number of ms to wait to recieve a response.</td> </tr> <tr> <td class="name">cb</td> <td class="type"> <span class="param-type"><a href="Client.html#~offsetsForTimesCallback">Client~offsetsForTimesCallback</a></span> </td> <td class="description last">Callback to fire with the filled in offsets.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line423">client.js, line 423</a> </li></ul> </dd> </dl> <h4 class="name" id="queryWatermarkOffsets"> <span class="type-signature"></span>queryWatermarkOffsets<span class="signature">(topic, partition, timeout, cb)</span><span class="type-signature"></span> </h4> <div class="description"> <p>Query offsets from the broker. This function makes a call to the broker to get the current low (oldest/beginning) and high (newest/end) offsets for a topic partition.</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">topic</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Topic to recieve offsets from.</td> </tr> <tr> <td class="name">partition</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Partition of the provided topic to recieve offsets from</td> </tr> <tr> <td class="name">timeout</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Number of ms to wait to recieve a response.</td> </tr> <tr> <td class="name">cb</td> <td class="type"> <span class="param-type"><a href="Client.html#~watermarkOffsetsCallback">Client~watermarkOffsetsCallback</a></span> </td> <td class="description last">Callback to fire with the offsets.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line377">client.js, line 377</a> </li></ul> </dd> </dl> <div class="clearfix"> <div class="grid-75"> <h3 class="heading-2">Type Definitions:</h3> </div> <div class="grid-25 top-link"> <small> <a href="#top" class="inverse"> <i class="icon-chevron-up"></i> &nbsp;Back to top. </a> </small> </div> </div> <h4 class="name" id="~connectionCallback"> <span class="type-signature"></span>connectionCallback<span class="signature">(err, metadata)</span><span class="type-signature"></span> </h4> <div class="description"> <p>This callback is used to pass metadata or an error after a successful connection</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">err</td> <td class="type"> <span class="param-type">Error</span> </td> <td class="description last">An error, if one occurred while connecting.</td> </tr> <tr> <td class="name">metadata</td> <td class="type"> <span class="param-type"><a href="Client.html#~Metadata">Client~Metadata</a></span> </td> <td class="description last">Metadata object.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line488">client.js, line 488</a> </li></ul> </dd> </dl> <h4 class="name" id="~Metadata">Metadata</h4> <div class="description"> <p> Metadata object. This is the representation of Kafka metadata in JavaScript. </p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">orig_broker_id</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">The broker ID of the original bootstrap broker.</td> </tr> <tr> <td class="name">orig_broker_name</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">The name of the original bootstrap broker.</td> </tr> <tr> <td class="name">brokers</td> <td class="type"> <span class="param-type">Array.&lt;<a href="Client.html#~MetadataBroker">Client~MetadataBroker</a>></span> </td> <td class="description last">An array of broker objects</td> </tr> <tr> <td class="name">topics</td> <td class="type"> <span class="param-type">Array.&lt;<a href="Client.html#~MetadataTopic">Client~MetadataTopic</a>></span> </td> <td class="description last">An array of topics.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line542">client.js, line 542</a> </li></ul> </dd> </dl> <h4 class="name" id="~MetadataBroker">MetadataBroker</h4> <h5>Type:</h5> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">id</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Broker ID</td> </tr> <tr> <td class="name">host</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Broker host</td> </tr> <tr> <td class="name">port</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Broker port.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line521">client.js, line 521</a> </li></ul> </dd> </dl> <h4 class="name" id="~MetadataPartition">MetadataPartition</h4> <h5>Type:</h5> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">id</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Partition id</td> </tr> <tr> <td class="name">leader</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Broker ID for the partition leader</td> </tr> <tr> <td class="name">replicas</td> <td class="type"> <span class="param-type">Array.&lt;number></span> </td> <td class="description last">Array of replica IDs</td> </tr> <tr> <td class="name">isrs</td> <td class="type"> <span class="param-type">Array.&lt;number></span> </td> <td class="description last">Arrqay of ISRS ids</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line534">client.js, line 534</a> </li></ul> </dd> </dl> <h4 class="name" id="~MetadataTopic">MetadataTopic</h4> <h5>Type:</h5> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">name</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Topic name</td> </tr> <tr> <td class="name">partitions</td> <td class="type"> <span class="param-type">Array.&lt;<a href="Client.html#~MetadataPartition">Client~MetadataPartition</a>></span> </td> <td class="description last">Array of partitions</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line528">client.js, line 528</a> </li></ul> </dd> </dl> <h4 class="name" id="~offsetsForTimesCallback"> <span class="type-signature"></span>offsetsForTimesCallback<span class="signature">(err, toppars)</span><span class="type-signature"></span> </h4> <div class="description"> <p>This callback is used to pass toppars or an error after a successful times query</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">err</td> <td class="type"> <span class="param-type">Error</span> </td> <td class="description last">An error, if one occurred while connecting.</td> </tr> <tr> <td class="name">toppars</td> <td class="type"> <span class="param-type">Array.&lt;<a href="global.html#TopicPartition">TopicPartition</a>></span> </td> <td class="description last">Topic partitions with offsets filled in</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line506">client.js, line 506</a> </li></ul> </dd> </dl> <h4 class="name" id="~watermarkOffsets">watermarkOffsets</h4> <h5>Type:</h5> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">high</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">High (newest/end) offset</td> </tr> <tr> <td class="name">low</td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Low (oldest/beginning) offset</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line515">client.js, line 515</a> </li></ul> </dd> </dl> <h4 class="name" id="~watermarkOffsetsCallback"> <span class="type-signature"></span>watermarkOffsetsCallback<span class="signature">(err, offsets)</span><span class="type-signature"></span> </h4> <div class="description"> <p>This callback is used to pass offsets or an error after a successful query</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Parameters:</h4> </div> </div> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">err</td> <td class="type"> <span class="param-type">Error</span> </td> <td class="description last">An error, if one occurred while connecting.</td> </tr> <tr> <td class="name">offsets</td> <td class="type"> <span class="param-type"><a href="Client.html#~watermarkOffsets">Client~watermarkOffsets</a></span> </td> <td class="description last">Watermark offsets</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line497">client.js, line 497</a> </li></ul> </dd> </dl> <h3 class="subsection-title">Events</h3> <h4 class="name" id="event:disconnected"> disconnected </h4> <div class="description"> <p>Disconnect event. Called after disconnection is finished.</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Type:</h4> </div> </div> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">connectionOpened</td> <td class="type"> <span class="param-type">date</span> </td> <td class="description last">when the connection was opened.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line300">client.js, line 300</a> </li></ul> </dd> </dl> <h4 class="name" id="event:ready"> ready </h4> <div class="description"> <p>Ready event. Called when the Client connects successfully</p> </div> <div class="clearfix"> <div class="grid-75"> <h4 class="heading-3">Type:</h4> </div> </div> <ul> <li> <span class="param-type">object</span> </li> </ul> <h5 class="subsection-title">Properties:</h5> <table class="props table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name">name</td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">the name of the broker.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"> <ul class="pager"><li> <a href="client.js.html#line214">client.js, line 214</a> </li></ul> </dd> </dl> </article> </section> </div> <div class="grid-25 pull-75"> <div class="navigation-sidebar"> <ul class="nav nav-list"> <li><a href="javascript: void(0);">Classes</a><ul class="nav nav-list" role="menu"><li><a href="AdminClient.html">AdminClient</a></li><li><a href="Client.html">Client</a></li><li><a href="HighLevelProducer.html">HighLevelProducer</a></li><li><a href="KafkaConsumer.html">KafkaConsumer</a></li><li><a href="KafkaConsumerStream.html">KafkaConsumerStream</a></li><li><a href="LibrdKafkaError.html">LibrdKafkaError</a></li><li><a href="Producer.html">Producer</a></li><li><a href="ProducerStream.html">ProducerStream</a></li></ul></li><li><a href="javascript: void(0);">Events</a><ul class="nav nav-list" role="menu"><li><a href="Client.html#event:disconnected">disconnected</a></li><li><a href="Client.html#event:ready">ready</a></li><li><a href="HighLevelProducer.html#event:disconnected">disconnected</a></li><li><a href="HighLevelProducer.html#event:ready">ready</a></li><li><a href="KafkaConsumer.html#event:data">data</a></li><li><a href="KafkaConsumer.html#event:disconnected">disconnected</a></li><li><a href="KafkaConsumer.html#event:ready">ready</a></li><li><a href="Producer.html#event:disconnected">disconnected</a></li><li><a href="Producer.html#event:ready">ready</a></li></ul></li><li><a href="javascript: void(0);">Tutorials</a><ul class="nav nav-list" role="menu"><li><a href="tutorial-consumer-flow.html">consumer-flow</a></li><li><a href="tutorial-consumer-per-partition.html">consumer-per-partition</a></li><li><a href="tutorial-consumer.html">consumer</a></li><li><a href="tutorial-docker-alpine.html">docker-alpine</a></li><li><a href="tutorial-high-level-producer.html">high-level-producer</a></li><li><a href="tutorial-metadata.html">metadata</a></li><li><a href="tutorial-producer-cluster.html">producer-cluster</a></li><li><a href="tutorial-producer_.html">producer</a></li></ul></li><h3>Global</h3><ul><li><a href="global.html#createAdminClient">createAdminClient</a></li><li><a href="global.html#createSerializer">createSerializer</a></li><li><a href="global.html#RefCounter">RefCounter</a></li><li><a href="global.html#Topic">Topic</a></li><li><a href="global.html#TopicPartition">TopicPartition</a></li></ul> </ul> <!-- <ul class="nav nav-list collapse"> --> </div> </div> </div> </div> </div> <!-- /.body-content --> <br class="clear"> <!-- FOOTER --> <footer class="footer"> <div class="grid-container"> <div class="footer-content"> <div class="grid-75"> <div class="legal"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc </a> on Thu Jan 11 2024 10:36:33 GMT+0100 (Central European Standard Time) </div> </div> <div class="grid-25"> <span class="blizzard">Blizzard® Entertainment</span> </div> </div> </div> </footer> <!-- /FOOTER --> <script> prettyPrint(); </script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <script src="toolkit/js/toolkit/toolkit.min.js"> </script> </body> </html>