I created an email queue where I put the requests for emails to be sent. If the SMTP server is unavailable, the requests are not lost.

When the SMTP server gets back online, the background service will pick up the requests to send the emails and process accordingly.

Question: I now have a requirement to deliver text messages with high certainty, but also to give feedback about a wrong phone number if that is possible. Should I have something like my mail queue to send text messages to my user phones or not?

I think it makes sense if we're talking about marketing messages, but what about text messages sent to users to verify their phone numbers?

What if their phone number is typed incorrectly? The phone API will tell me right away but if I put the request in the queue, I won't be able to let them know about it.

Rephrasing of the question: Should I care about the immediate feedback and loose the ability to deliver all SMS messages in case of temporary failure?

  • This isn't really a programming requirement. It's a business type of requirement. Also, I assume there is no way to validate a phone number without sending the message? If you could validate the phone number, that can be an optional step that gets skipped in the case of temporary failure. Sep 30, 2014 at 23:00
  • Not sure I understand what you mean by business requirement. We all program for business requirements and most of the time the business doesn't know what they want or need. In this case, the business wants all messages to be delivered with certainty and, if possible, give feedback about a wrong a phone number instead of saying blindly "You will receive a code shortly". Makes sense? Sep 30, 2014 at 23:27
  • Should there be another stack exchange where I can put this question, I'll be happy to do that, but, at the moment, I can't think of one. Sep 30, 2014 at 23:28

1 Answer 1


Depending on the API for sending text messages, there are two possibilities for meeting those business requirements.

  • If there are separate API calls to verify a phone number and to send a text message, you can use a queue for the actual sending and verify the validity of the phone number just before you put the text message in the queue.
  • If there is only an API call to send a text message, which informs you about success/failure after the fact and where the failure codes are descriptive enough, you could send the message initially from the context of the user request. If that fails with a temporary error, add the message to a queue for later retries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.