Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Targeted' does not support null values #2687

Open
marekczajkowski opened this issue Jul 10, 2024 · 1 comment
Open

'Targeted' does not support null values #2687

marekczajkowski opened this issue Jul 10, 2024 · 1 comment
Labels

Comments

@marekczajkowski
Copy link

marekczajkowski commented Jul 10, 2024

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.

@ozangunalp
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants