The imagery of suffering and torment in this psalm surely reflects that of Jesus on the cross: bones out of joint, pierced hands and feet, lots cast for his clothing, people mocking him. Jesus endures this for us because of his love for his Father and for us and all sinners. He perfectly fulfills all this - not just symbolically. I don't know of a situation when David's hands and feet were pierced, but Jesus' certainly were - literally. Jesus also fulfills this most telling of hope's expression:
Posterity shall serve him;
it shall be told of the Lord to the coming generation;
they shall come and proclaim his righteousness to a people yet unborn,
that he has done it. (v. 30-31)
Thanks be to God that he has done it. Whenever we are facing severe suffering and distress, we can look with Jesus to a day of redemption and the consummation of his salvation. I like to put it this way:
Jesus is the fulfillment of Psalm 22 and all Old Testament promises and prophecies. I all comes together in him.