I have tried setting in my di.xml:
<preference for="Magento\Quote\Observer\Frontend\Quote\Address\CollectTotalsObserver"
type="Vendor\Module\Observer\Frontend\Quote\Address\CollectTotalsObserver"/>
Isn’t it possible to do this for an observer? I do not just want to listen to the event, I need to change the existing code, because it connects to an external service and I need to avoid double connections to it.
Thanks for your help