are flings ok?

Is it wrong to break up with my now boyfriend to have a fling with another guy for a few months? I have been into this guy for a few years now (only been dating my boyfriend about 3 months) but we’ve been talking about having a thing before he leaves next May. It’s very tempting but how do I say yes to a relationship I already know will end?