appsody / stacks

Appsody application stacks. This repo will be archived soon.
https://appsody.dev
Apache License 2.0
89 stars 121 forks source link

nodejs-express: Shut down Kafka clients when HTTP server is closed #832

Closed djones6 closed 4 years ago

djones6 commented 4 years ago

This PR illustrates how to avoid a hang when running the stack tests where the application makes connections to external services.

Checklist:

Modifying an existing stack:

I have added a callback on the HTTP server close event, to disconnect the Kafka producer and consumer. This allows the process to terminate normally.

Related Issues:

Resolves #831

djones6 commented 4 years ago

@gireeshpunathil Do you think this can be merged?

gireeshpunathil commented 4 years ago

@gireeshpunathil Do you think this can be merged?

Yes. @neeraj-laad - for your review

(Ironically, I am a maintainer of the stack, but not a maintainer of this repo)

Kamran64 commented 4 years ago

@gireeshpunathil - Usually we wait to see an approval from the stack maintainer before merging. @djones6 - Please could you bump the stack version in the stack.yaml and then we can get this merged. Thanks!

gireeshpunathil commented 4 years ago

@gireeshpunathil - Usually we wait to see an approval from the stack maintainer before looking.

can you pls document this? It is neither evident here, nor an established practice in OSS

neeraj-laad commented 4 years ago

@gireeshpunathil I've added you as a stack maintainers group.

Also the review for maintainers is documents in our contribution process.

neeraj-laad commented 4 years ago

@djones6 please can you bump the stack version so we can merge this?