什么:
有人可以帮助我理解此错误消息的含义。nsqadmin
显示很多消息正在重新排队/超时。这些日志可能是原因吗?
我在用pynsq 0.4.2
堆栈跟踪
2013-07-30 13:34:18,827 DEBUG redistributing RDY state (1 conns > 500 max_in_flight)
2013-07-30 13:34:18,828 DEBUG [ip-10-114-195-89:4150:nsq_msg_handler] rdy: 1 (last message received 268.32s)
2013-07-30 13:34:18,828 INFO [ip-10-114-195-89:4150:nsq_msg_handler] idle connection, giving up RDY count
2013-07-30 13:34:18,828 INFO [ip-10-114-195-89:4150:nsq_msg_handler] redistributing RDY
代码
def connect_nsq(self):
r = nsq.Reader(message_handler=self.nsq_msg_handler, lookupd_http_addresses=["127.0.0.1:4161"], topic="test_topic", channel="test_channel", max_in_flight=500)
nsq.run()
# callback
def nsq_msg_handler(self, message):
try:
before_ts = get_utc_now_ts()
json_data = json.loads(message.body)
my_data = json_data["key1"]
my_data = json_data["key2"]
my_data = json_data["key3"]
after_ts = get_utc_now_ts()
delta = after_ts - before_ts
logger.debug("took %f seconds for json_data _id: %s" % (delta, json_data["_id"]))
except Exception as reason:
print reason, traceback.format_exc()
return False
return true