All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Muslim scholars held three opinions in this regard; the Hanafi scholars ruled that blood, pus excretions and the like invalidate the ablution if they emanated from one of the ablution organs. The Hanbali scholars ruled that such excretions invalidate the ablution if they flow out heavily. As for the Shaafi‘i and Maaliki scholars, they ruled that those excretions do not invalidate ablution, which is the preponderant opinion in this regard, Allaah willing. There are several pieces of evidence backing this opinion, one of which is the story of the Companion ‘Abbaad ibn Bishr when he got hit by arrows during his prayer, yet he continued praying. [Al-Bukhari as a Mu‘allaq Hadeeth; Abu Daawood and Ibn Khuzaymah]
It is unlikely that the Prophet, sallallaahu ‘alayhi wa sallam, did not know about this famous incident.
Additionally, ‘Umar ibn Al-Khattaab, may Allah be pleased with him, prayed while the blood was spurting out of his wound, and the same happened with many wounded Muslims who prayed while their wounds were bleeding.
Hence, it is permissible for you to continue your prayer even if secretions are coming out of your ulcer, especially since your condition is chronic; accordingly your case entails applying the ruling of people with unusual circumstances such as women experiencing vaginal bleeding outside the menstrual period and people who suffer from urinary incontinence or gas incontinence.
We beseech Allaah The Exalted to cure you and all sick Muslims.
Allaah Knows best.