Skip event in case of key extraction exception

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Skip event in case of key extraction exception

Jayant Ameta
Hi,
My key extraction logic requires a conversion from string to UUID. I want to skip the event in case of exception. Is it doable?
Reply | Threaded
Open this post in threaded view
|

Re: Skip event in case of key extraction exception

Dawid Wysakowicz-2
Hi,
You cannot filter out events in the KeyExtractor. What you can do though is to move the conversion logic to e.g. flatMap function and emit only those events that where successfully converted. Then your KeyExtractor would be a single getter for the UUID.
Best,
Dawid

On 13/08/18 07:45, Jayant Ameta wrote:
Hi,
My key extraction logic requires a conversion from string to UUID. I want to skip the event in case of exception. Is it doable?