It's entirely up to you and what risks you feel comfortable taking.
First pregnancy I went to Egypt at 5 months. No problems. My only concern was that they had airport type security scanners at the hotel and all the tourist sites - I didn't want to go through them several times a day so just walked round them and stuck my stomach out (only got sent through once).
Second pregnancy went to Thailand at 3 months. Got a bit uncomfortable on the flight back - was glad we had a stopover to stretch my legs. Only concern was looking a bit big not pregnant in my swimming costume!
But.... I know a lot of people who thought I was mad (not my GP or midwife - they were absolutely fine). I did think carefully about them both. Egypt was booked after I was pregnant, Thailand before. I have done a lot of travelling and backpacked round loads of places, rarely getting ill. I am also veggie which I think helps to avoid stomach upsets. We toned down the sightseeing and lazed around more than usual as the heat was tiring. I was also up to date with jabs so didn't need any while pregnant.
We had no qualms taking our 2 year old DD to Sri Lanka a few years ago, staying in a pretty nice beach hotel. None of us got ill. I have travelled round the country twice before and didn't get ill.
Personally if we hadn't already booked Thailand (pregnancy was a bit of a surprise) I don't think I would have gone long haul when pregnant. Flying with someone like Emirates so you get to stretch your legs in Dubai on the way might be a good idea. I don't know what the hospitals are like in Sri Lanka - I imagine they may well be better in Thailand or Malaysia if there are any problems. Foodwise - lots of curries in Sri Lanka but you can get chips/pizza/cheese sandwiches when you need a break from them!
If you are looking at this as a last chance to go away somewhere exotic then, we first went longhaul with our DD to Malaysia when she was 18 months, so having a baby doesn't have to stop you!
Sorry this is so long - hope it helps!