Search in sources :

Example 1 with MessageId

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;
}
Also used : Message(org.apache.qpid.amqp_1_0.client.Message) ArrayList(java.util.ArrayList) Data(org.apache.qpid.amqp_1_0.type.messaging.Data) EventData(org.apache.storm.eventhubs.spout.EventData) Binary(org.apache.qpid.amqp_1_0.type.Binary) Section(org.apache.qpid.amqp_1_0.type.Section) EventData(org.apache.storm.eventhubs.spout.EventData) MessageId(org.apache.storm.eventhubs.spout.MessageId)

Aggregations

ArrayList (java.util.ArrayList)1 Message (org.apache.qpid.amqp_1_0.client.Message)1 Binary (org.apache.qpid.amqp_1_0.type.Binary)1 Section (org.apache.qpid.amqp_1_0.type.Section)1 Data (org.apache.qpid.amqp_1_0.type.messaging.Data)1 EventData (org.apache.storm.eventhubs.spout.EventData)1 MessageId (org.apache.storm.eventhubs.spout.MessageId)1