[bug fix] TDIS-5520 add type checking in MessagingService