In the struggle for the independence of Peru, the hero acted as secret emissary carrying messages between the Government of Callao and Lima Patriots by swimming.
When José de San Martín recognized the little support given to political and military forces, he resigned from the Constituent Congress of Peru, 1822.
The royal army, taking advantage of the fact that the patriotic troops were far away, took Lima and members of Congress took refuge in the Real Felipe Fortress in Callao.
It is at this stage that José Olaya, a fisherman by trade, did not hesitate to serve as a link between the ships of the squadron Liberator (formed by units of the Republic of Chile) and the soldiers of the patriotic forces (Argentina, Chile and Peru) located in Lima, even if it meant walking across fields and swimming in the sea.
Finally, on the morning of June 29, 1823 he uttered the phrase: If I had a thousand lives, I would gladly give them for my homeland.The Avenida Jose Olaya in Lima, Callao, Chorrillos and Villa María del Triunfo, Peru are named after him.