Disclosed is an ostomy device with an adhesive wafer for attachment to a skin surface (S) of a user and a collecting bag (8) or collecting output from a stoma. The collecting bag is connected to the adhesive wafer, and the adhesive wafer has a through-going hole (6) for accommodating the stoma (7) of the user. The adhesive wafer includes a backing layer (3), a first switchable adhesive composition (2), a second absorbent adhesive composition (1), and a release liner, and the second adhesive layer has a central portion with a first thickness and an edge portion with a second thickness, the first thickness being larger than the second thickness.