read topics and msgs from db