The Messenger of Allah ﷺ used to command marriage and strictly forbid celibacy, saying, "Marry the loving and fertile, for I will boast of your numbers before the other prophets on the Day of Resurrection."
كان رسول الله ﷺ يأمر بالباءة، وينهي عن التبتل نهيا شديدا، ويقول: تزوجوا الودود الولود، إني مكاثر الأنبياء يوم القيامة.
Ahmad narrated it (12613) from Husayn and Affan, and Bazzar in Kashf Astar (1400) via the route of Muhammad bin Muawiya, and Ibn Hibban in his Sahih (4028) via the route of Qutayba bin Saeed, and Bayhaqi (7/81–82) via the route of Ibrahim bin Abu Abbas, all of them from Khalaf bin Khalifa, who said, Hafs bin Umar narrated to me, from Anas bin Malik, and he related it.Its chain is hasan because of the discussion surrounding Khalaf bin Khalifa, though he is hasan al-hadith. Ibn Main and Nasai said of him, "There is no harm in him." Ibn Main also, and Abu Hatim, said, "Truthful." Ibn Adi said, "I hope there is no harm in him, though I cannot absolve him of erring occasionally in some of his narrations."Imam Ahmad also narrated it (13569) from Affan, who said, Khalaf bin Khalifa narrated to us. Abdullah said, my father said, "I saw Khalaf bin Khalifa, and a man said to him, 'O Abu Ahmad, did Muharib bin Dithar narrate to you?'" My father said, "I could not make out his speech, for he had grown old, so I left him alone." He narrated to us, from Hafs, from Anas bin Malik, who said, "The Messenger of Allah ﷺ used to command marriage and forbid celibacy," and he related the hadith.It appears from Imam Ahmad's account that he did not narrate from him because of his confusion in old age, but since he found the hadith transmitted from two of his teachers, namely Husayn and Affan, he narrated it through them, perhaps because their hearing from him predated his confusion. However, it has not become clear to me who among those I have mentioned heard from him before his confusion and who heard from him after it.