开发者

Professional Advice: Messaging Solution

I am putting together an application for a bulk SMS solution. I am comfortable writing the application in Java, Perl or PHP.

Kindly advise on the best medium to handle asynchronous messaging delivery.

I do have credentials with the networks i.e:

  • IP
  • Port
  • Username
  • Password
  • etc

for SMPP connectivity.

I am looking at the following:

  1. User upload a CSV or XLS file from the web
  2. The numbers and messages are saved in a database
  3. I create a cron to check database periodically for messages that are queued to be sent
  4. Messages to be sent are forwarded to an active MQ (A messaging tool by APACHE).
  5. MQ forward to t开发者_如何学编程he network
  6. MQ receives acknowledgement and delivery status from network and update the database.

Kindly point out if my concept is on track or if there is a better solution.


The fact that you are talking about SMS messages (which is an asynchronous message hanldling system) confuses things a little - in practice it doesn't matter - the important thing is that you are trying to write a asynchronous message handling system to do something.

There are no end of ready made solutions for queueing and processing messages. Previously I've used the BSD lpd for low volumes of SMS/fax. You could equally use an MTA, or a tool specifically designed for SMS handling such as Kannel. IME, dealing with aggregators providing multiple different APIs it proved more effective to roll my own solution.

If you are going to write your own solution, don't use cron.

When your cron job fires, do you only pick up one message and process it? Do you try to pick up all the available messages and process them? What if that takes more than the interval between the cron jobs? While the messaging subsystem (BEFORE your subscriber - NOT after) would take some of the complexity out of this, but it doesn't solve all the problems.

The right way to do this is with a daemon process either running as a single thread or with planned sharding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜