I'm trying to build a microservice architecture that is, basically, comprised of a service that has a public endpoint that accept messages from our client and, based on the message type, puts them in the appropriate message queue. Then consumers take messages from their queues and process them, usually making API calls and etc.
What I can't figure out is how do I return an appropriate HTTP response code, instead of always returning 200?
I would like to return error codes if processing encounters an error but I don't see how that can be feasible as the endpoint service needs to be available to accept messages, while the only way I think it's possible to know what code to return is to wait for the service that process the message to tell it if everything was OK or not, which will take time.
Our clients don't have separate endpoints that we can send information on.
Is there a way to have a microservice that only accepts messages and puts them in queues and still have it return error codes based on how the message was processed without it being unavailable during processing?