Skip to content

Commit

Permalink
add get message method in Record interface (apache#4341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrypeng authored May 24, 2019
1 parent d6c2813 commit 92f0cee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.pulsar.functions.api;

import org.apache.pulsar.client.api.Message;

import java.util.Collections;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -104,4 +106,8 @@ default void fail() {
default Optional<String> getDestinationTopic() {
return Optional.empty();
}

default Optional<Message<T>> getMessage() {
return Optional.empty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ public void ack() {
public void fail() {
this.failFunction.run();
}

@Override
public Optional<Message<T>> getMessage() {
return Optional.of(message);
}
}

0 comments on commit 92f0cee

Please sign in to comment.