blob: b7720221ef400d4639fd7d5974c3986154070c0a [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_112) on Mon Dec 18 11:25:21 EST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>KafkaProducer (Apache Edgent (incubating) v1.2.0 API)</title>
<meta name="date" content="2017-12-18">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="KafkaProducer (Apache Edgent (incubating) v1.2.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/KafkaProducer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaConsumer.StringConsumerRecord.html" title="interface in org.apache.edgent.connectors.kafka"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/connectors/kafka/KafkaProducer.html" target="_top">Frames</a></li>
<li><a href="KafkaProducer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.edgent.connectors.kafka</div>
<h2 title="Class KafkaProducer" class="title">Class KafkaProducer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.edgent.connectors.kafka.KafkaProducer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">KafkaProducer</span>
extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><code>KafkaProducer</code> is a connector for publishing a stream of tuples
to Apache Kafka messaging system topics.
<p>
The connector uses and includes components from the Kafka 0.8.2.2 release.
It has been successfully tested against kafka_2.11-0.10.1.0 and kafka_2.11-0.9.0.0 server as well.
For more information about Kafka see
<a href="http://kafka.apache.org">http://kafka.apache.org</a>
<p>
Sample use:
<pre><code>
String bootstrapServers = "localhost:9092";
String topic = "mySensorReadingsTopic";
Map&lt;String,Object&gt; config = new HashMap&lt;&gt;();
config.put("bootstrap.servers", bootstrapServers);
Topology t = ...
KafkaProducer kafka = new KafkaProducer(t, () -&gt; config);
TStream&lt;JsonObject&gt; sensorReadings = t.poll(
() -&gt; getSensorReading(), 5, TimeUnit.SECONDS);
// publish as sensor readings as JSON
kafka.publish(sensonReadings, tuple -&gt; tuple.toString(), topic);
</code></pre></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaProducer.html#KafkaProducer-org.apache.edgent.topology.Topology-org.apache.edgent.function.Supplier-">KafkaProducer</a></span>(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;t,
<a href="../../../../../org/apache/edgent/function/Supplier.html" title="interface in org.apache.edgent.function">Supplier</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;&gt;&nbsp;config)</code>
<div class="block">Create a producer connector for publishing tuples to Kafka topics.s</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaProducer.html#publish-org.apache.edgent.topology.TStream-java.lang.String-">publish</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;stream,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;topic)</code>
<div class="block">Publish the stream of tuples as Kafka key/value records
to the specified partitions of the specified topics.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaProducer.html#publish-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-">publish</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;T&gt;&nbsp;stream,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;keyFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;valueFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;topicFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;partitionFn)</code>
<div class="block">Publish the stream of tuples as Kafka key/value records
to the specified partitions of the specified topics.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaProducer.html#publishBytes-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-">publishBytes</a></span>(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;T&gt;&nbsp;stream,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,byte[]&gt;&nbsp;keyFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,byte[]&gt;&nbsp;valueFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;topicFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;partitionFn)</code>
<div class="block">Publish the stream of tuples as Kafka key/value records
to the specified topic partitions.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="KafkaProducer-org.apache.edgent.topology.Topology-org.apache.edgent.function.Supplier-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>KafkaProducer</h4>
<pre>public&nbsp;KafkaProducer(<a href="../../../../../org/apache/edgent/topology/Topology.html" title="interface in org.apache.edgent.topology">Topology</a>&nbsp;t,
<a href="../../../../../org/apache/edgent/function/Supplier.html" title="interface in org.apache.edgent.function">Supplier</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;&gt;&nbsp;config)</pre>
<div class="block">Create a producer connector for publishing tuples to Kafka topics.s
<p>
See the Apache Kafka documentation for <code>KafkaProducer</code>
configuration properties at <a href="http://kafka.apache.org">http://kafka.apache.org</a>.
Configuration property values are strings.
<p>
The Kafka "New Producer configs" are used. Minimal configuration
typically includes:
<ul>
<li><code>bootstrap.servers</code></li>
</ul>
<p>
The full set of producer configuration items are specified in
<code>org.apache.kafka.clients.producer.ProducerConfig</code></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>t</code> - Topology to add to</dd>
<dd><code>config</code> - KafkaProducer configuration information.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="publishBytes-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>publishBytes</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;T&gt;&nbsp;publishBytes(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;T&gt;&nbsp;stream,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,byte[]&gt;&nbsp;keyFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,byte[]&gt;&nbsp;valueFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;topicFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;partitionFn)</pre>
<div class="block">Publish the stream of tuples as Kafka key/value records
to the specified topic partitions.
<p>
If a valid partition number is specified that partition will be used
when sending the message. If no partition is specified but a key is
present a partition will be chosen using a hash of the key.
If neither key nor partition is present a partition will be assigned
in a round-robin fashion.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Tuple type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stream</code> - the stream to publish</dd>
<dd><code>keyFn</code> - A function that yields an optional byte[]
Kafka record's key from the tuple.
Specify null or return a null value for no key.</dd>
<dd><code>valueFn</code> - A function that yields the byte[]
Kafka record's value from the tuple.</dd>
<dd><code>topicFn</code> - A function that yields the topic from the tuple.</dd>
<dd><code>partitionFn</code> - A function that yields the optional topic
partition specification from the tuple.
Specify null or return a null value for no partition specification.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology"><code>TSink</code></a></dd>
</dl>
</li>
</ul>
<a name="publish-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>publish</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;T&gt;&nbsp;publish(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;T&gt;&nbsp;stream,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;keyFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;valueFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;topicFn,
<a href="../../../../../org/apache/edgent/function/Function.html" title="interface in org.apache.edgent.function">Function</a>&lt;T,<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;&nbsp;partitionFn)</pre>
<div class="block">Publish the stream of tuples as Kafka key/value records
to the specified partitions of the specified topics.
<p>
This is a convenience method for <code>String</code> typed key/value
conversion functions.
<p></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - Tuple type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stream</code> - the stream to publish</dd>
<dd><code>keyFn</code> - A function that yields an optional String
Kafka record's key from the tuple.
Specify null or return a null value for no key.</dd>
<dd><code>valueFn</code> - A function that yields the String for the
Kafka record's value from the tuple.</dd>
<dd><code>topicFn</code> - A function that yields the topic from the tuple.</dd>
<dd><code>partitionFn</code> - A function that yields the optional topic
partition specification from the tuple.
Specify null or return a null value for no partition specification.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology"><code>TSink</code></a></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaProducer.html#publishBytes-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-"><code>publishBytes(TStream, Function, Function, Function, Function)</code></a></dd>
</dl>
</li>
</ul>
<a name="publish-org.apache.edgent.topology.TStream-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>publish</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology">TSink</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;publish(<a href="../../../../../org/apache/edgent/topology/TStream.html" title="interface in org.apache.edgent.topology">TStream</a>&lt;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;stream,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;topic)</pre>
<div class="block">Publish the stream of tuples as Kafka key/value records
to the specified partitions of the specified topics.
<p>
This is a convenience method for a String stream published
as a Kafka record with no key and
a value consisting of the String tuple serialized as UTF-8,
and publishing round-robin to a fixed topic's partitions.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>stream</code> - the stream to publish</dd>
<dd><code>topic</code> - The topic to publish to</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../../org/apache/edgent/topology/TSink.html" title="interface in org.apache.edgent.topology"><code>TSink</code></a></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaProducer.html#publish-org.apache.edgent.topology.TStream-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-org.apache.edgent.function.Function-"><code>publish(TStream, Function, Function, Function, Function)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/KafkaProducer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/edgent/connectors/kafka/KafkaConsumer.StringConsumerRecord.html" title="interface in org.apache.edgent.connectors.kafka"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li>Next&nbsp;Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/edgent/connectors/kafka/KafkaProducer.html" target="_top">Frames</a></li>
<li><a href="KafkaProducer.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2016&#x2013;2017 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>