diff --git a/nsqd/topic.go b/nsqd/topic.go index d02c82989..727085a76 100644 --- a/nsqd/topic.go +++ b/nsqd/topic.go @@ -46,7 +46,7 @@ func NewTopic(topicName string, nsqd *NSQD, deleteCallback func(*Topic)) *Topic t := &Topic{ name: topicName, channelMap: make(map[string]*Channel), - memoryMsgChan: nil, + memoryMsgChan: make(chan *Message, ctx.nsqd.getOpts().MemQueueSize), startChan: make(chan int, 1), exitChan: make(chan int), channelUpdateChan: make(chan int), @@ -56,10 +56,6 @@ func NewTopic(topicName string, nsqd *NSQD, deleteCallback func(*Topic)) *Topic deleteCallback: deleteCallback, idFactory: NewGUIDFactory(nsqd.getOpts().ID), } - // create mem-queue only if size > 0 (do not use unbuffered chan) - if nsqd.getOpts().MemQueueSize > 0 { - t.memoryMsgChan = make(chan *Message, nsqd.getOpts().MemQueueSize) - } if strings.HasSuffix(topicName, "#ephemeral") { t.ephemeral = true t.backend = newDummyBackendQueue()