I wouldn't necessarily call it an anti-pattern but depending on how the queue receives the events it might be better to separate both operations into their own microservices.
If the work queue is to be filled by data from some client it wouldn't be unreasonable to keep the processing logic internal to the api. The api receives data, processes it, sends it to the database, and returns the data to the client. Depending on how persistent the data needs to be you might not even need the database at all in this case.
If the work queue is self-populating or receives its processing queue from another internal source, it would make more sense to separate the queue processor and the api. One microservice to process data and send it to a database, and another microservice serving an api which handles requests, query the database, and return the data.
+-----------------+ +-----------+ +-----+ +--------+ | Queue Processor | -> | Database | -> | Api | -> | Client | +-----------------+ +-----------+ +-----+ +--------+
In short, it the queue and API are inherently coupled it makes sense to keep everything tied together, otherwise it would be better to separate those concerns and develop them as individual microservces.