Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Last active July 30, 2018 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chathurangat/308a697ef347bcd5471516c780f57d74 to your computer and use it in GitHub Desktop.
Save chathurangat/308a697ef347bcd5471516c780f57d74 to your computer and use it in GitHub Desktop.
@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