-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use Try for ConsumerMessage value #133
Conversation
3bed06f
to
128695d
Compare
128695d
to
d6037b8
Compare
I also went ahead and reverted some library versions based on our discussion in #127. |
@@ -7,15 +7,15 @@ travisBuildNumber in Global := sys.env.getOrElse("TRAVIS_BUILD_NUMBER", "0") | |||
def travisVersion(v: String, tb: String): String = v.stripSuffix("-SNAPSHOT") + s".$tb-SNAPSHOT" | |||
|
|||
val org = "com.sksamuel.pulsar4s" | |||
val AkkaStreamVersion = "2.6.1" | |||
val AkkaStreamVersion = "2.5.28" // compatible with Akka 2.5.x and 2.6.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -18,6 +18,8 @@ trait ConsumerMessage[T] { | |||
|
|||
def value: T | |||
|
|||
def valueTry = Try(value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valueSafe ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I slightly prefer the Try
naming since it's clear what it is. There are many reasons why something might be "safe" or "unsafe".
Ok.
…On Sun, 2 Feb 2020, 23:56 Greg Methvin, ***@***.***> wrote:
Merged #133 <#133> into master.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#133>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGS7NHTCUZDAAK5JKS3RA6WX5ANCNFSM4KNPJ2YQ>
.
|
@sksamuel can we do a new release for this? |
yep, will do tonight.
…On Mon, 3 Feb 2020 at 12:49, Greg Methvin ***@***.***> wrote:
@sksamuel <https://github.com/sksamuel> can we do a new release for this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#133>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGS5MNI2BD5EUZ4L6GDRBBRM5ANCNFSM4KNPJ2YQ>
.
|
alright thanks! |
2.4.6 is up on maven
…On Tue, 4 Feb 2020 at 16:03, Greg Methvin ***@***.***> wrote:
alright thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#133>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGQU7VMFZSJSGRWG4U3RBHQ4LANCNFSM4KNPJ2YQ>
.
|
Allow
ConsumerMessage
instances to be able to represent a Pulsar message whose value cannot be parsed. This brings the behavior roughly in line with the Java client, which will allow you to create messages with invalid data but will throw whengetValue
is called. It also prevents the Akka streams source from failing immediately upon creating theConsumerMessage
, allowing the user code to decide how to handle the error.