What are your thoughts on having a service/process be both an API server and a background worker, consuming messages off a queue like SQS?
I have typically kept these two separate to keep single responsibilities for each, but also it seems weird, at least in NodeJS, to have an API server bootstrap itself to be an API server but then also start polling a queue for jobs to be done.
Is it a fairly common practice to mix the two into the same service? If not other other strong reasons to keep them separate? Also somewhat tangential but would the same logic apply for an API server and a Kafka consumer?