Skip to content

Commit 0e93249

Browse files
authored
Merge pull request #278 from contacthari21/master
pollTimeout : Set pollTimeout during client creation
2 parents 960194f + a4dae01 commit 0e93249

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

kafka-webview-ui/src/main/java/org/sourcelab/kafka/webview/ui/manager/kafka/WebKafkaConsumerFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ private ClientConfig.Builder createClientConfig(
172172
.withTopicConfig(topicConfig)
173173
.withConsumerId(consumerId)
174174
.withPartitions(view.getPartitionsAsSet())
175-
.withMaxResultsPerPartition(view.getResultsPerPartition());
175+
.withMaxResultsPerPartition(view.getResultsPerPartition())
176+
.withPollTimeoutMs(view.getPollTimeoutMs());
176177

177178
final List<RecordFilterDefinition> recordFilterDefinitions = new ArrayList<>();
178179

kafka-webview-ui/src/main/java/org/sourcelab/kafka/webview/ui/model/View.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public class View {
7373
@Column(nullable = false)
7474
private Integer resultsPerPartition = 10;
7575

76+
@Column(nullable = false)
77+
private long pollTimeoutMs = 5000;
78+
7679
@OneToMany(
7780
fetch = FetchType.LAZY,
7881
cascade = { CascadeType.PERSIST, CascadeType.MERGE },
@@ -159,6 +162,14 @@ public void setResultsPerPartition(final Integer resultsPerPartition) {
159162
this.resultsPerPartition = resultsPerPartition;
160163
}
161164

165+
public long getPollTimeoutMs() {
166+
return pollTimeoutMs;
167+
}
168+
169+
public void setPollTimeoutMs(long pollTimeoutMs) {
170+
this.pollTimeoutMs = pollTimeoutMs;
171+
}
172+
162173
/**
163174
* @return Returns the defined partitions as a Set.
164175
*/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE `view` ADD COLUMN IF NOT EXISTS poll_timeout_ms INT NOT NULL DEFAULT 5000 AFTER partitions;

0 commit comments

Comments
 (0)