Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
@EnableBinding(Sink.class)
public class OrderListener
{
private static final Logger logger = LoggerFactory.getLogger(OrderListener.class);
@StreamListener(target = Sink.INPUT)
public void listenForOrder(Order order)
{
logger.info(" received new order ["+order.toString()+"] ");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment