OOIION-1786: Make message encoding interceptor more efficient