die Messe
fair / trade show
A large event where companies present and sell their products and services; a trade or public exhibition.
Nächste Woche fahre ich zur Buchmesse nach Frankfurt.
Next week I'm going to the book fair in Frankfurt.

fair / mass
Loading your saved state.
fair / trade show
A large event where companies present and sell their products and services; a trade or public exhibition.
Nächste Woche fahre ich zur Buchmesse nach Frankfurt.
Next week I'm going to the book fair in Frankfurt.

You can recognize the meaning of 'Messe' (fair/Mass) from context. If it is about business, products, and halls, an exhibition (m01) is meant. If it is about church, Sunday, or a church service, the religious celebration (m02) is meant.
Auf der Automesse werden die neuesten Modelle vorgestellt.
The newest models are presented at the auto show.
When it refers to an exhibition, the prepositions 'auf' and 'zu' are used. You are 'auf der Messe' (at the fair) and you go 'zur Messe' (to the fair).
Ich habe auf der Messe viele interessante Leute getroffen.
I met many interesting people at the fair.
In connection with exhibitions, 'Messe' (fair/trade show) is often used in compounds to specify the type. Common verbs are 'besuchen' (to visit/attend) or 'ausstellen' (to exhibit).
Viele Verlage stellen auf der Buchmesse ihre Neuheiten aus.
Many publishers exhibit their new releases at the book fair.
When the Catholic church service is meant, the preposition 'in' is used. You go 'in die Messe' (to Mass) and you sit 'in der Messe' (in Mass).
Der Priester lädt die Gemeinde ein, die Messe mitzufeiern.
The priest invites the congregation to celebrate Mass together.
When a musical composition is being discussed, 'Messe' (Mass) often appears together with the name of a composer or musical terms such as 'Chor' (choir) and 'Orchester' (orchestra).
Der Chor probt für die Aufführung von Bachs h-Moll-Messe.
The choir is rehearsing for the performance of Bach's Mass in B minor.
market
'der Markt' and 'die Messe' can both be places or events where goods are displayed or sold. 'der Markt' is often more regular and everyday, for example a weekly market with fruit, vegetables, or cheese. 'die Messe' is usually a larger event, often in a hall, where companies present their products. The words can be confused because at both you can see, compare, or buy things. For fresh food and small stalls, 'Markt' sounds more natural. For a large exhibition with companies, 'Messe' fits better.

Sie besucht die Messe, weil sie neue Fahrräder testen möchte.
She is visiting the trade show because she wants to test new bicycles.
Am Samstag kaufe ich auf dem Markt frisches Gemüse und Brot.
On Saturday, I buy fresh vegetables and bread at the market.