In many of my personal and professional projects inevitably comes the moment where we have to weight pros and cons of integrating third parties versus developping a home solution. I've always been a fervent user of open source resources and faced programmers I respect who were following other path. The arguments are complex and I often get lost in what are pros and cons of using third parties in general.
As an example one of the project I work for implements a message broker with a custom protocol. I am fairly sure it could have been implemented by using a 3rd party message AMQP broker. It would reduce the code base, and, although I can't be sure yet, may enhance overall performance and stability.
I'm still new to the project and probably missing something, but isn't this a case of reinventing the wheel, or is there pitfalls in using 3rd parties I am not aware of ? I am looking if there is a general guideline for "borderline" cases where both options (using a 3rd party or developing in-house) are realistic.