Add rule validation on message encoding.