smallrye-reactive-messaging icon indicating copy to clipboard operation
smallrye-reactive-messaging copied to clipboard

'Targeted' does not support null values

Open marekczajkowski opened this issue 1 year ago • 1 comments

NullPointerException is thrown when trying to create Targeted with null value.

@Incoming("in")
@Outgoing("out1")
@Outgoing("out2")
public Targeted process(Double price) {
    return Targeted.of("out1", price)
}

It is a common case when we want to delete some item from channel using null value. Default Targeted implementation should support null values.

marekczajkowski avatar Jul 10 '24 11:07 marekczajkowski

The underlying map for the implementation doesn't support null keys and values, that's why you are having the NPE. While I agree that null values can be supported, if, for example in case of Kafka, you'd like to send a tombstone, you'd like to send a key and a null value, instead of only a null value.

ozangunalp avatar Jul 17 '24 06:07 ozangunalp