-
Notifications
You must be signed in to change notification settings - Fork 257
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
[Bug] Message type mismatch causes the dispatcher stopped #2648
Comments
Hi, here is another issue that we are facing. We are using transformer to perform schema validation & send the message to DLQ (not sure is it correct if we do in this way) |
@phuaxinyuin Will take a look |
Hi @iancooper, may I know if there is any update for this issue? |
Hi @siewching-lim - I would like to understand the behavior you would expect. Brighter needs to know if something is a Command (one handler) or Event (many handlers). This may be clearer with an internal bus, but we still have to make choice. If the sender does not tell us, we assume an event (you might have many handlers). To fix this you can simply make your handler an event handler as opposed to a command handler. Our alternative would be to assume it is a command. The problem here is that makes the most restrictive assumption. |
Hi @iancooper, thanks for your reply. I hope that Brighter will not prevent me from passing the messages into message mappers, since we are using Transformer to perform schema validation for both the headers and the body of the messages in that layer. Could you please provide an option for us to skip the message type validation step ( Additionally, I noticed that when I pass in a value that is not a valid GUID as the MessageId, it blocks my message from reaching the message mapper layer. Could you kindly provide an option to automatically generate a new GUID for the MessageId if the value is invalid? |
Hi @iancooper, do you have any update on this issue? |
So I think what we are asking here is:
Is that the requirement here? |
I am working on a couple of bug fixes for V10, so I might be able to add that |
Hi @iancooper, thank you for your reply. Regarding the MessageId, you’ve understood my request correctly: if one is not provided, a GUID-based message id should be generated. |
|
Hi @iancooper, thanks for your reply again. Yes, I'm using a command handler within my application. However, I am of the opinion that the ability to configure the default message type may not provide a solution to my current predicament. This is because there exists a possibility that the producer might publish a message with an MT_EVENT type. This could halt the dispatcher due to a mismatch between the message type and the handler type. This is the crux of the issue we are facing. To paint a clearer picture, let me delve into the specifics of my use case. Our application is designed with schema validation, which is seamlessly integrated with the Brighter message mapper through a transformer. Under normal circumstances, if a producer inadvertently dispatches a Kafka message with MT_EVENT or a null message type, it would fail the schema validation. Consequently, the message would be redirected to the dead letter queue, bypassing the process in command handler entirely. However, we’re currently grappling with a persistent issue. Whenever a user inputs a message type that isn’t MT_COMMAND, the application will be stop processing the next message. Ideally, we would like the application to continue processing subsequent messages, despite any preceding errors. Hope you can help us to solve this issue. |
Thanks that is a clearer requirement. Let me ponder. It sounds as though we may want a flag that lets the user control whether Brighter considers a message type validation error to be fatal or not. We would need to commit the offset (ack) in this case as we would otherwise never clear that message. |
I appreciate your prompt response. Kindly keep me informed with the latest updates. |
Hi @iancooper,
We are performing some testing on the message header of command request and the dispatcher will stopped when one of the messages hit the message type mismatch error.
Here is the scenario,
(We try to exclude the message type from the header to perform the testing)
We found out that Brighter will set the messageType to "MT_EVENT" when the messageType key/value was not found from the Kafka message
Brighter will throw a ConfigurationException & dispatcher will stopped after this.
Would like to know if there any way can prevent the dispatcher stop processing the next message?
If one of the messages hit the ConfigurationException, the channel will be disposed and other messages cannot be proceed.
The text was updated successfully, but these errors were encountered: