Skip to content

Commit

Permalink
Code changes to handle null delivery issue hobbit-project#45
Browse files Browse the repository at this point in the history
  • Loading branch information
sourabhpoddar404 committed Nov 28, 2019
1 parent c5c57ad commit bde3c4a
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;

import org.apache.commons.io.IOUtils;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;
Expand Down Expand Up @@ -124,8 +123,12 @@ protected void collectResponses() throws Exception {
//Wait for delivery message
Delivery delivery = consumer.getDeliveryQueue().poll(QUEUEPOLLTIMEOUT, TimeUnit.MILLISECONDS);
// parse the response
try
if (delivery == null)
{
LOGGER.error("No Message Received after waiting for ten minutes");
return;
}

buffer = ByteBuffer.wrap(delivery.getBody());


Expand All @@ -151,11 +154,7 @@ protected void collectResponses() throws Exception {


evaluateResponse(expectedData, receivedData, taskSentTimestamp, responseReceivedTimestamp);
}catch(NullPointerException e)

{
LOGGER.error("No Message Received after waiting for ten minutes");
}
}
}

Expand Down

0 comments on commit bde3c4a

Please sign in to comment.