You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how i prevent sending empty string '' if number is odd, like prevent .to from running and just move to next stream data? if defeats the purpose of multiple branching topics for me
my code
how i prevent sending empty string '' if number is odd, like prevent .to from running and just move to next stream data? if defeats the purpose of multiple branching topics for me
my code
`const checkforOdd = (kafkaMessage) => {
const value = kafkaMessage.value.toString("utf8");
// console.log(value)
if(!(parseInt(value) % 2 == 0)){
return value
}else{
return ''
}
};
const checkforEven = (kafkaMessage) => {
const value = kafkaMessage.value.toString("utf8");
if(parseInt(value) % 2 == 0){
};
const kafkaStreams = new KafkaStreams(config);
kafkaStreams.on("error", (error) => {
console.log("Error occured:", error.message);
});
const stream = kafkaStreams.getKStream('test-topic');
const [one$, two$] = stream
.branch([() => true, () => true]);
const producerPromiseOne = one$
.map(checkforOdd)
.to("odd");
const producerPromiseTwo = two$
.map(checkforEven)
.to("even");`
The text was updated successfully, but these errors were encountered: