Skip to content

Conversation

@mongodb-matthew-normyle
Copy link
Contributor

@mongodb-matthew-normyle mongodb-matthew-normyle commented Oct 29, 2024

This PR adds a stream processor modify method. It can be used to modify the definition of a stream processor.

@mongodb-matthew-normyle
Copy link
Contributor Author

mongodb-matthew-normyle commented Oct 29, 2024

I also manually tested this change against the ASP service with the below:

AtlasStreamProcessing> sp.createStreamProcessor("testedit2", [{$source: {connectionName: "DemoKafka", topic: "t1"}}, {$project: {device_id: 1, foo: "bar"}}, {$project: {_stream_meta: 0}}, {$emit: {connectionName: "DemoKafka", topic: "testedit2"}}])
Atlas Stream Processor: testedit2
AtlasStreamProcessing> sp.testedit2.start()
{ ok: 1 }
AtlasStreamProcessing> sp.testedit2.stop()
{ ok: 1 }
AtlasStreamProcessing> sp.testedit2.modify([{$source: {connectionName: "DemoKafka", topic: "t1"}}, {$project: {device_id: 1, foo: "BAZ"}}, {$project: {_stream_meta: 0}}, {$emit: {connectionName: "DemoKafka", topic: "testedit2"}}])
{ ok: 1 }
AtlasStreamProcessing> sp.testedit2.start()
{ ok: 1 }

AtlasStreamProcessing> sp.testedit2.stop()
{ ok: 1 }
AtlasStreamProcessing> sp.testedit2.modify([{$source: {connectionName: "DemoKafka", topic: "t2"}}, {$project: {device_id: 1, foo: "BAZ"}}, {$project: {_stream_meta: 0}}, {$emit: {connectionName: "DemoKafka", topic: "testedit2"}}])
MongoServerError[CommandFailed]: Failed to modify stream processor: resumeFromCheckpoint must be false to modify a stream processor's $source stage, correlationID = 180301c57e0eb1d90df3d548

@mongodb-matthew-normyle mongodb-matthew-normyle marked this pull request as ready for review October 29, 2024 19:37
@mongodb-matthew-normyle
Copy link
Contributor Author

mongodb-matthew-normyle commented Oct 29, 2024

The failures in the evergreen build seem to be known issues:
image

@mongodb-matthew-normyle mongodb-matthew-normyle changed the title MONGOSH-1864: Support stream processor modify feat(shell-api): add stream processor modify MONGOSH-1864 Oct 30, 2024
@addaleax
Copy link
Collaborator

addaleax commented Nov 1, 2024

@mongodb-matthew-normyle The outstanding CI failures are known flaky/failing tests, so this would be good to merge if you're read 👍

@mongodb-matthew-normyle
Copy link
Contributor Author

@mongodb-matthew-normyle The outstanding CI failures are known flaky/failing tests, so this would be good to merge if you're read 👍

Hi @addaleax, I'm ready to merge :) It appears I don't have write access to merge my PR. Are you able to hit merge for me? Thanks in advance.

@addaleax addaleax merged commit 0a85da0 into mongodb-js:main Nov 1, 2024
70 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants