I dont think your challenge is where to run the background task as much as
it is how to handle sending of large number of messages between systems. I
would recommend you look at leveraging a messaging broker like ActiveMQ that
will allow you to send messages asynchronously to a message queue that can
then be picked up for processing by your java application with some JMS
client code.
have a look here for some example code on writing a JMS client in JRuby that
would allow you to put messages onto the queue
http://blog.dberg.org/2008/07/jms-jruby-producer-and-consumer.html. That is
of course if you are using JRuby.
If you are using straight MRI ruby/rails then have a look at integrating
ActiveMQ with Activemessaging using the STOMP Protocol.
http://code.google.com/p/activemessaging/wiki/ActiveMessaging
Adam
On Mon, Jul 28, 2008 at 6:53 PM, Rm Rm
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>wrote:
>
> Hi,
>
> I need advice on a decision that I have to make to decide whether I
> should do background task in Rails or in Tomcat.
>
> What I need to do is that a user of web app will create nnumber of text
> messages which need to be sent to around 10,000+ users. Sms msg is
> passed by the Ruby application to a http server running under Tomcat to
> a java application that further passes the msg to sms gateway to be
> deliverd to user.
> I am planning to put msgs to be sent in a table in mysql by the ruby
> application. Now I am not sure which is the reliable and better way to
> send the msgs in the background - a background task in ruby or a
> backgorund task in java. Also which is the best way to schedule and
> start a background job in ruby/rails to handle such a large number of
> records to be handled?
>
> Thanks for the help in advance.
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---