Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Slf4j
@EnableBinding(OrderSink.class)
public class OrderListener
{
@StreamListener(target = OrderSink.INPUT,condition = "headers['payment_mode']=='cash'")
public void listenForCashOrder(Order order)
{
log.info(" received new CASH order {} ",order.toString());
}
@StreamListener(target = OrderSink.INPUT,condition = "headers['payment_mode']=='credit'")
public void listenForCreditOrder(Order order)
{
log.info(" received new CREDIT order {} ",order.toString());
}
@StreamListener(target = OrderSink.INPUT,condition = "headers['payment_mode']=='cheque'")
public void listenForChequeOrder(Order order)
{
log.info(" received new CHEQUE order {} ",order.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment