Selectively masking data in messages is provided. A masking expression is retrieved from a schema. The masking expression corresponds to a particular attribute within related messages generated by a producer application and sent to an immutable datastore for consumption by a consumer application of the computer that is registered to receive the messages related to a particular topic from the immutable datastore. A particular attribute value is masked only in those messages received from the immutable datastore that contain the particular attribute value during a time period when the particular attribute value is associated with the masking expression.