use of org.apache.storm.eventhubs.spout.MessageId in project storm by apache.
the class EventHubReceiverMock method receive.
@Override
public EventData receive(long timeoutInMilliseconds) {
if (isPaused) {
return null;
}
currentOffset++;
List<Section> body = new ArrayList<Section>();
//the body of the message is "message" + currentOffset, e.g. "message123"
body.add(new Data(new Binary(("message" + currentOffset).getBytes())));
Message m = new Message(body);
MessageId mid = new MessageId(partitionId, "" + currentOffset, currentOffset);
EventData ed = new EventData(m, mid);
return ed;
}
Aggregations