-
Notifications
You must be signed in to change notification settings - Fork 200
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
fix: add config to process messages concurrently #2026
fix: add config to process messages concurrently #2026
Conversation
|
da1b2a1
to
3281bc5
Compare
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.
Good updates! Thanks
filter((e) => e.payload.message.id === encryptedMessage.id), | ||
filter((e) => e.payload.message.type === encryptedMessage.type), |
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.
an encrypted message does not have an id
and type
right?
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.
Sorry, I missed this
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.
- But here there are no common properties I can map to. Can you suggest me a way to add a guard here or filter specific encrypted message?
…ncurrently Signed-off-by: Pritam Singh <[email protected]>
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
05caec4
to
9a37419
Compare
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
observable | ||
.pipe( | ||
filter((e) => e.type === AgentEventTypes.AgentMessageProcessed), | ||
filter((e) => deepEquality(e.payload.encryptedMessage, encryptedMessage)), |
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 think we can just check for equality right (===)? AS the object will be passed around? Using deep object equality can be expensive
@@ -64,7 +65,7 @@ class Dispatcher { | |||
await next() | |||
} | |||
|
|||
public async dispatch(messageContext: InboundMessageContext): Promise<void> { | |||
public async dispatch(messageContext: InboundMessageContext, encryptedMessage?: EncryptedMessage): Promise<void> { |
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.
What if we add encryptedMessage
to the InboundMessageContext
( as it's related to the incoming message)
filter((e) => e.type === AgentEventTypes.AgentMessageProcessed), | ||
filter((e) => deepEquality(e.payload.encryptedMessage, encryptedMessage)), | ||
timeout({ | ||
first: 10000, // timeout after 10 seconds |
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 think it's less relevant here to await the processing? As we don't do anything afterwards
filter((e) => e.type === AgentEventTypes.AgentMessageProcessed), | ||
filter((e) => deepEquality(e.payload.encryptedMessage, encryptedMessage)), | ||
timeout({ | ||
first: 10000, // timeout after 10 seconds |
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.
Let's add this as a param to the constructor of the HttpInboundTransport class?
Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
@sairanjit can you resolve the conflicts? I think we're good to merge! |
…t/concurrent-message-processing Signed-off-by: Sai Ranjit Tummalapalli <[email protected]>
@TimoGlastra Resolved conflicts now |
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.
Thanks so much for processing all the feedback!!
…on#2026) Signed-off-by: Pritam Singh <[email protected]> Signed-off-by: Sai Ranjit Tummalapalli <[email protected]> Co-authored-by: Pritam Singh <[email protected]> Signed-off-by: Martin Auer <[email protected]>
cc: @Zzocker : Taking it further from #1276
@TimoGlastra From the earlier conversations how can we handle the queue from inbound transport?