How did Jews at the time of Joseph of Mary know that the Messiah was near? There are 300 prophecies in the Old Testament about the coming of the Messiah (all 300 Old Testament prophecies are listed in the back of my book The Crucified Rabbi with their New Testament fulfillments - a feature worth the price of the book).
However, there are two prophecies in particular that notified the Jews of the first century that the Messiah was very close if not already present. The first is the prophecies of Daniel 2 and 7. These predict the coming of the Son of Man during the "fourth pagan kingdom" that would rule over Jerusalem. Rome was that the fourth kingdom that began to rule Judea in 63 BC. This would signal that the Messianic age was about to begin. This video further explains the Old Testament chronology of Daniel leading up to Christ:
The other important prophecy that was well known was one from Genesis. In Genesis chapter 49:
“The sceptre shall not be taken away from Juda, nor a ruler from his thigh, till he come that is to be sent, and he shall be the expectation of nations. Tying his foal to the vineyard, and his ass, O my son, to the vine. He shall wash his robe in wine, and his garment in the blood of the grape.” (Genesis 49:10–11, D-R)
Here the Holy Spirit tells us that the sceptre (rule or self-sovereignty) of Israel will not be taken away from Judah till he come that is to be sent, and he shall be the expectation of the nations. Here also is the reference to the foal and the ass which Christ rode on Palm Sunday. This Bible verse caused such hysteria on Palm Sunday because the people realized the signification - Jesus Christ was he that is to be sent and the expectation of the nations. The next reference to wine and the blood refers to the Eucharist and the Passion, but the inhabitants of Jerusalem did not understand this meaning.
In summary, the Jews at the time of Mary and Joseph and just before know that the coming of the Romans signified the coming of the Messiah. They read this Genesis and Daniel.