How feasible it is to switch a communication protocol of a product?
I had a question regarding networking and communication. It is not my forte and I am pretty new to it. Can somebody please tell me how feasible it is to switch a product using one protocol partially or entirely to a new protocol for communication? Also what kind of development and programming paradigms do I need to follow in case I need to design a product which might require a change in the future on which protocol it is using?
For e.g. Consider a hypothetical scenario where, I am developing a product that will use MQTT for communication. In future MQTT support stops due to any abrupt reason and I need to switch to HTTP REST API. Then how should I develop the product now so that in the future I have minimum effort to switch. Moreover will I need to rewrite entire product or are there an methods which do not require complete rewriting. The motive is that the product can evolve or adapt easily.
What are the Pros and Cons Involved in the process?