// Skip when processing payload synchronously - returning `null`@Incoming("in")@Outgoing("out")publicStringprocessPayload(Strings){if(s.equalsIgnoreCase("skip")){returnnull;}returns.toUpperCase();}// Skip when processing message synchronously - returning `null`@Incoming("in")@Outgoing("out")publicMessage<String>processMessage(Message<String>m){Strings=m.getPayload();if(s.equalsIgnoreCase("skip")){m.ack();returnnull;}returnm.withPayload(s.toUpperCase());}// Skip when processing payload asynchronously - returning a `Uni` with a `null` value@Incoming("in")@Outgoing("out")publicUni<String>processPayloadAsync(Strings){if(s.equalsIgnoreCase("skip")){// Important, you must not return `null`, but a `null` contentreturnUni.createFrom().nullItem();}returnUni.createFrom().item(s.toUpperCase());}// Skip when processing message asynchronously - returning a `Uni` with a `null` value@Incoming("in")@Outgoing("out")publicUni<Message<String>>processMessageAsync(Message<String>m){Strings=m.getPayload();if(s.equalsIgnoreCase("skip")){m.ack();returnUni.createFrom().nullItem();}returnUni.createFrom().item(m.withPayload(s.toUpperCase()));}
Skipping in a stream
To skip a message or payload when manipulating a stream, emit an emptyMulti (or Publisher):