public StreamConsumer createStreamConsumer(QueueName streamName, ConsumerConfig consumerConfig) throws IOException {
String namespace = String.format("%s.%s", programId.getApplicationId(), programId.getId());
final StreamConsumer consumer = streamConsumerFactory.create(streamName, namespace, consumerConfig);
dataSetContext.addTransactionAware(consumer);
return new ForwardingStreamConsumer(consumer) {
@Override
public void close() throws IOException {
super.close();
dataSetContext.removeTransactionAware(consumer);
}