// TODO (terence): Actually need to coordinates with other flowlets to drain the queue.
TransactionContext txContext = dataFabricFacade.createTransactionManager();
txContext.start();
try {
((Closeable) consumer).close();
txContext.finish();
} catch (TransactionFailureException e) {
LOG.warn("Fail to commit transaction when closing consumer.");
txContext.abort();
}
}