Use message repository in resource