For the very first time, the correlation femtoscopy method is applied to a kinematically complete measurement of meson production in the collisions of hadrons. A two-proton correlation function was derived from the data for the pp -> ppX reaction, measured near the threshold of eta meson production. A technique developed for the purpose of this analysis permitted to establish the correlation function separately for the production of the pp+eta and of the pp+pions systems. The shape of the two-proton correlation function for the ppeta differs from that for the pp(pions) and both do not show a peak structure opposite to results determined for inclusive measurements of heavy ion collisions.