In the Gospel of Barnabas Jesus did not consider himself the Messiah, but preached that Muhammad was to be the Messiah:
Jesus confessed and said the truth: ‘I am not the Messiah … I am indeed sent to the house of Israel as a prophet of salvation; but after me shall come the Messiah’. (The Gospel of Barnabas, see 82:3, 96:2-3, 97:1, 97:6).