Using Spring Data Stream, How can I start reading from a queue and stop reading on demand?
I want to so something like this:
@EnableBinding(Sink.class)
public class SomeConsumer {
@StreamListener(target = Sink.INPUT)
public void receiveMsg(Message<String> message)
{
logger.info(" received new message [" + message.toString() + "] ");
}
public static void startReceiving()
{
//How to implement this logic?
}
public static void stopReceiving()
{
//How to implement this logic?
}
}