You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The app should be signaled somehow by op-rabbit about an unparsable item delivered by RabbitMQ in order to take specific actions.(e.g. raise specific service logs, increment specific stats etc..)
Solution:
To address this case we'd need a new directive in order to signal in invalid message(i.e. unparsable message) to the client code:
bodyEither(as[JobDescription]) { jobDescriptionEither => // alarm the reason and take specific action
I'd like to also add in DirectivesSpec a test to prove that when the unmarashalling of the body fails then a Either.Left is produced with the cause.
Unfortunately, the only unmarshallers visisble in DirectivesSpec are UTF8StringMarshaller and BinaryMarshaller so it hard to make marshaling fail.
In order to achieve this the import com.spingo.op_rabbit.PlayJsonSupport._ needs to be resolved in DirectivesSpec which currently does not happen due to project structure. If there is a workarround to this I'd be happy to also add Either.Left test. Though I tested successfully the Either.Left in a mini app where I could import anything I needed.
Also, op-rabbit has support for publishing failed items to an error queue, I believe, isn't this one of the strategies? Maybe this would be a way to handle failed parsing?
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
The app should be signaled somehow by op-rabbit about an unparsable item delivered by RabbitMQ in order to take specific actions.(e.g. raise specific service logs, increment specific stats etc..)
Solution:
To address this case we'd need a new directive in order to signal in invalid message(i.e. unparsable message) to the client code: