public void addMessageReference(final ConnectionContext context, final MessageId messageId,
final ReferenceData data) {
final ReferenceRecord record = new ReferenceRecord(messageId.toString(), data);
final int subscriberCount = subscriberMessages.size();
if (subscriberCount > 0) {
final StoreEntry messageEntry = messageContainer.place(messageId, record);
addInterest(record);
final TopicSubAck tsa = new TopicSubAck();
tsa.setCount(subscriberCount);
tsa.setMessageEntry(messageEntry);
final StoreEntry ackEntry = ackContainer.placeLast(tsa);
for (final Iterator<TopicSubContainer> i = subscriberMessages.values().iterator(); i.hasNext();) {
final TopicSubContainer container = i.next();
final ConsumerMessageRef ref = new ConsumerMessageRef();
ref.setAckEntry(ackEntry);
ref.setMessageEntry(messageEntry);