If you don't want to receive spam messages, you can block these contacts on the Google Messenger app using the archive box.
Messenger app, press and hold a contact or phone number and tap
When the contact sends you messages, you will not see them in the
Messenger screen or receive notifications and calls.
To read blocked messages in the archived box, on the
Messenger screen, tap