devinbost commented on issue #6054:
URL: https://github.com/apache/pulsar/issues/6054#issuecomment-843675423
@lhotari I reproduced the issue with using this as the Pulsar Function:
```
public class RandomFilterFunction implements Function<String, String> {
private Random rand = new Random();
@Override
public String process(String input, Context context) {
double passFraction =
Double.parseDouble((String)context.getUserConfigValueOrDefault("pass-fraction",
"0.5"));
if (rand.nextDouble() < passFraction) {
return input;
} else {
return null;
}
}
}
```
I chained one function (with parallelism of 4) to another function (with
parallelism of 4), both using the same class.
The first function in the flow has a `pass-fraction` of "0.3", and the other
one is default.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]