New API for checking pending message count