-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ParsingFailureAction and related API changes (#7)
* sealed trait Delivery - Ok and MalformedContent * PullResult instead of Option for RabbitMQPullConsumer * ConversionException to api module
- Loading branch information
Showing
24 changed files
with
421 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 19 additions & 1 deletion
20
api/src/main/scala/com/avast/clients/rabbitmq/api/Delivery.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
package com.avast.clients.rabbitmq.api | ||
|
||
case class Delivery[A](body: A, properties: MessageProperties, routingKey: String) | ||
import com.avast.bytes.Bytes | ||
|
||
sealed trait Delivery[+A] { | ||
def properties: MessageProperties | ||
|
||
def routingKey: String | ||
} | ||
|
||
object Delivery { | ||
|
||
case class Ok[+A](body: A, properties: MessageProperties, routingKey: String) extends Delivery[A] | ||
|
||
case class MalformedContent(body: Bytes, properties: MessageProperties, routingKey: String, ce: ConversionException) | ||
extends Delivery[Nothing] | ||
|
||
def apply[A](body: A, properties: MessageProperties, routingKey: String): Delivery.Ok[A] = { | ||
Delivery.Ok(body, properties, routingKey) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
api/src/main/scala/com/avast/clients/rabbitmq/api/exceptions.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.avast.clients.rabbitmq.api | ||
|
||
case class ConversionException(desc: String, cause: Throwable = null) extends RuntimeException(desc, cause) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.