Open adelgadocabrera opened 2 years ago
This is to differentiate whether the connection is closed or timeout occurred while polling (returns null). If i would have just returned null then the application would still keep on polling from the queue even when the connection is closed.
Oh, I see I see. Thanks
I don't understand why throw connection exception for empty list? Why not just return null? Perhaps I'm not seeing something.
https://github.com/CS682-S22/dsd-pub-sub-project-anchitbhatia/blob/1cdf79e83816160c8ea636020afb70f7988ad19b/src/main/java/api/Consumer.java#L46-L48