Jesus was speaking towards the end of the feast of the Booth or Tabernacle.

www.bible.com/100/jhn.7.38.nasb

This water pouring, was satire of Jewish tradition, of the foreshadowing of a future time, of rivers of living water (Holy Spirit). Ez 47:1-9.

Jesus was saying, he is the fulfillment of Ezekiel 47. He was the one who would give eternal life.