Skip to content

Commit 4475cbb

Browse files
author
翊名
committed
feat(pullconsumer) change the jdk version requirment from 1.8 to 1.7
1 parent c1fbb64 commit 4475cbb

4 files changed

Lines changed: 11 additions & 12 deletions

File tree

openmessaging-api-samples/src/main/java/io/openmessaging/samples/consumer/PullConsumerApp.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import io.openmessaging.api.OMS;
2323
import io.openmessaging.api.PullConsumer;
2424
import io.openmessaging.api.TopicPartition;
25-
import java.time.Duration;
2625
import java.util.List;
2726
import java.util.Properties;
2827
import java.util.Set;
@@ -48,7 +47,7 @@ public void run() {
4847
consumer.assign(topicPartitions);
4948
consumer.start();
5049

51-
List<Message> message = consumer.poll(Duration.ofMillis(1000));
50+
List<Message> message = consumer.poll(1000);
5251
System.out.println("Received message: " + message);
5352
//Acknowledge the consumed message
5453
consumer.commitSync();

openmessaging-api/src/main/java/io/openmessaging/api/OnExceptionContext.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class OnExceptionContext {
3535
*/
3636
private OMSRuntimeException exception;
3737

38+
3839
public String getMessageId() {
3940
return messageId;
4041
}

openmessaging-api/src/main/java/io/openmessaging/api/PullConsumer.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package io.openmessaging.api;
1818

19-
import java.time.Duration;
2019
import java.util.Collection;
2120
import java.util.List;
2221
import java.util.Set;
@@ -65,13 +64,13 @@ interface TopicPartitionChangeListener {
6564
* Fetch data for the topics or partitions specified using assign API. It is an error to not have subscribed to any
6665
* topics or partitions before polling for data.
6766
*
68-
* @param timeout
67+
* @param timeout in millisecond
6968
* @return
7069
*/
71-
List<Message> poll(Duration timeout);
70+
List<Message> poll(long timeout);
7271

7372
/**
74-
* Overrides the fetch offsets that the consumer will use on the next {@link #poll(Duration)} }. If this API is invoked
73+
* Overrides the fetch offsets that the consumer will use on the next {@link #poll(long)} }. If this API is invoked
7574
* for the same message queue more than once, the latest offset will be used on the next poll(). Note that you may
7675
* lose data if this API is arbitrarily used in the middle of consumption.
7776
*
@@ -82,22 +81,22 @@ interface TopicPartitionChangeListener {
8281

8382
/**
8483
* Overrides the fetch offsets with the beginning offset in server that the consumer will use on the next {@link
85-
* #poll(Duration)} }.
84+
* #poll(long)} }.
8685
*
8786
* @param topicPartition
8887
*/
8988
void seekToBeginning(TopicPartition topicPartition);
9089

9190
/**
9291
* Overrides the fetch offsets with the end offset in server that the consumer will use on the next {@link
93-
* #poll(Duration)} }.
92+
* #poll(long)} }.
9493
*
9594
* @param topicPartition
9695
*/
9796
void seekToEnd(TopicPartition topicPartition);
9897

9998
/**
100-
* Suspend fetching from the requested message queues. Future calls to {@link #poll(Duration)} will not return any
99+
* Suspend fetching from the requested message queues. Future calls to {@link #poll(long)} will not return any
101100
* records from these message queues until they have been resumed using {@link #resume(Collection)}.
102101
*
103102
* Note that this method does not affect message queue subscription. In particular, it does not cause a group
@@ -109,7 +108,7 @@ interface TopicPartitionChangeListener {
109108

110109
/**
111110
* Resume specified message queues which have been paused with {@link #pause(Collection)}. New calls to {@link
112-
* #poll(Duration)} will return records from these partitions if there are any to be fetched. If the message queues were
111+
* #poll(long)} will return records from these partitions if there are any to be fetched. If the message queues were
113112
* not previously paused, this method is a no-op.
114113
*
115114
* @param topicPartitions

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5252

5353
<!-- Compiler settings properties -->
54-
<maven.compiler.source>1.8</maven.compiler.source>
55-
<maven.compiler.target>1.8</maven.compiler.target>
54+
<maven.compiler.source>1.7</maven.compiler.source>
55+
<maven.compiler.target>1.7</maven.compiler.target>
5656
</properties>
5757

5858
<modules>

0 commit comments

Comments
 (0)