Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consumer creation exceptions are not handled #262

Open
KannarFr opened this issue Dec 29, 2020 · 5 comments
Open

Consumer creation exceptions are not handled #262

KannarFr opened this issue Dec 29, 2020 · 5 comments

Comments

@KannarFr
Copy link
Member

When creating to consume a non-exisiting namespace, the java pulsar client prints a lot of exceptions like:

org.apache.pulsar.client.api.PulsarClientException$LookupException:  Policies not found for <tenant>/<namespace> namespace

This is normal, but pulsar4s should provide consumer creation in a Try. WDYT?

@gmethvin
Copy link
Collaborator

gmethvin commented Dec 29, 2020

That probably makes sense, but I'd want to make sure we're consistent about using Try to encapsulate errors anywhere we'd throw. In other words if we make such a change I'd rather break the API all at once rather than changing methods individually to return Try.

That said I'm not really that worried about this case because most people should be using the async APIs anyway.

@KannarFr
Copy link
Member Author

KannarFr commented Jan 4, 2021

@sksamuel WDYT?

@sksamuel
Copy link
Contributor

sksamuel commented Jan 4, 2021

I agree with Greg. We should be either all in on Try or just use exceptions.
Really I should have called these methods dosomethingUnsafe and then dosomething() returns a Try. That doesn't help us now though.

@KannarFr
Copy link
Member Author

KannarFr commented Jan 4, 2021

I agree too. So, let's make breaking changes?

@sksamuel
Copy link
Contributor

sksamuel commented Jan 4, 2021

I don't think we should break all the methods now was kind of what I was meaning unless it was a 3.0 release, but then we need pulsar to do that too.

I'd be happy to add new methods / deprecate old ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants