You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Pat <cp...@yahoo.com> on 2007/06/25 13:35:29 UTC
email within action
Hello
Is it possible to send an email within an action? How/What are the issues? Is this scalable? How does it play with the framework and multiple simultaneous clients? Any insight would be appreciated.
Re: email within action
Posted by Oguz Kologlu <oz...@optusnet.com.au>.
Depends on what you want to do really. As Guru points out you can use
Web Services though that can grow unwieldy. For something light and
pretty straightforward you may just want to use JSON (javascript
object notation) or Xml HttpRequests. Have a look at the showcase
project in S2 on how to use the Dojo toolkit.
Oz
On 25/06/2007, at 11:29 PM, Chris Pat wrote:
> Hi
> Thank you. This was quite enlightening and gets me in the correct
> direction. Being a newbie, I am unabashed to ask another
> associated question. Can one use JMS as a replacement for RMI? I
> am looking for a very lightweight api to just allow a client to
> call an objects method on the server deployed on tomcat5x.
>
> Oguz Kologlu <oz...@optusnet.com.au> wrote:
> On 25/06/2007, at 10:33 PM, Chris Pat wrote:
>
>> Hello
>> How can I send the email asynchronously? My timeframe is the
>> lifecycle of the action and my browser session.
> Well you will probably not be doing the emailing async but rather
> firing off an async request to send an email ( eg send "hello world"
> to this list of 1000 recipients) and response to the client (ie
> browser) that the emails are going out. You really don't have to wait
> for an email to be sent since email is a store and forward mechanism
> anyway with no guaranteed delivery.
>
> You probably need to read up a little on messaging. As Guru also said
> a JMS server would meet your needs.
>
> There's generally a JMS server built into most app servers or you can
> plug one in if it doesn't have one. A good list at:
>
> http://mule.codehaus.org/display/MULE/Configuring+Jms
>
> I've used ActiveMQ before and it's quite stable/reliable. It's run
> for a few months without problems (though not under heavy load), YMMV.
>
> HTH
> Oz
>
>
>> Can I really get a mail session and send from within an action?
>> Doesnt that assume I am threading the process? When would this
>> breakdown? At 100/hr or 1000/hr? Thank you.
>>
>> Oguz Kologlu wrote: yes, The main issue
>> will response times if you a send emails
>> synchronously ( if you can you send async). Async will definitely
>> scale better since the client isn't blocking a thread for nothing.
>> Simultaneous clients should be no problem as long as you follow the
>> same threading rules as everything else shared vars etc.
>>
>> For high loads you should use messaging. There's a ton of stuff on
>> the net about async programming but it really depends on your
>> environment. For a full JEE setup I'd probably use a Message Driven
>> Bean. What sort of volume are you looking at and what's the
>> environment?
>>
>> Oz
>>
>>
>> On 25/06/2007, at 9:35 PM, Chris Pat wrote:
>>
>>> Hello
>>> Is it possible to send an email within an action? How/What are the
>>> issues? Is this scalable? How does it play with the framework and
>>> multiple simultaneous clients? Any insight would be appreciated.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: email within action
Posted by "Raghupathy, Gurumoorthy" <Gu...@nielsen.com>.
Nope that is not possible with JMS ... you may wish to use web services
.... have a look at axis2 from apache ....
RMI / WEBSERVICES are synchronous.... while JMS is not....
Regards
Guru
-----Original Message-----
From: Chris Pat [mailto:cpanon@yahoo.com]
Sent: 25 June 2007 14:30
To: Struts Users Mailing List
Subject: Re: email within action
Hi
Thank you. This was quite enlightening and gets me in the correct
direction. Being a newbie, I am unabashed to ask another associated
question. Can one use JMS as a replacement for RMI? I am looking for a
very lightweight api to just allow a client to call an objects method on
the server deployed on tomcat5x.
Oguz Kologlu <oz...@optusnet.com.au> wrote:
On 25/06/2007, at 10:33 PM, Chris Pat wrote:
> Hello
> How can I send the email asynchronously? My timeframe is the
> lifecycle of the action and my browser session.
Well you will probably not be doing the emailing async but rather
firing off an async request to send an email ( eg send "hello world"
to this list of 1000 recipients) and response to the client (ie
browser) that the emails are going out. You really don't have to wait
for an email to be sent since email is a store and forward mechanism
anyway with no guaranteed delivery.
You probably need to read up a little on messaging. As Guru also said
a JMS server would meet your needs.
There's generally a JMS server built into most app servers or you can
plug one in if it doesn't have one. A good list at:
http://mule.codehaus.org/display/MULE/Configuring+Jms
I've used ActiveMQ before and it's quite stable/reliable. It's run
for a few months without problems (though not under heavy load), YMMV.
HTH
Oz
> Can I really get a mail session and send from within an action?
> Doesnt that assume I am threading the process? When would this
> breakdown? At 100/hr or 1000/hr? Thank you.
>
> Oguz Kologlu wrote: yes, The main issue
> will response times if you a send emails
> synchronously ( if you can you send async). Async will definitely
> scale better since the client isn't blocking a thread for nothing.
> Simultaneous clients should be no problem as long as you follow the
> same threading rules as everything else shared vars etc.
>
> For high loads you should use messaging. There's a ton of stuff on
> the net about async programming but it really depends on your
> environment. For a full JEE setup I'd probably use a Message Driven
> Bean. What sort of volume are you looking at and what's the
> environment?
>
> Oz
>
>
> On 25/06/2007, at 9:35 PM, Chris Pat wrote:
>
>> Hello
>> Is it possible to send an email within an action? How/What are the
>> issues? Is this scalable? How does it play with the framework and
>> multiple simultaneous clients? Any insight would be appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: email within action
Posted by Chris Pat <cp...@yahoo.com>.
Hi
Thank you. This was quite enlightening and gets me in the correct direction. Being a newbie, I am unabashed to ask another associated question. Can one use JMS as a replacement for RMI? I am looking for a very lightweight api to just allow a client to call an objects method on the server deployed on tomcat5x.
Oguz Kologlu <oz...@optusnet.com.au> wrote:
On 25/06/2007, at 10:33 PM, Chris Pat wrote:
> Hello
> How can I send the email asynchronously? My timeframe is the
> lifecycle of the action and my browser session.
Well you will probably not be doing the emailing async but rather
firing off an async request to send an email ( eg send "hello world"
to this list of 1000 recipients) and response to the client (ie
browser) that the emails are going out. You really don't have to wait
for an email to be sent since email is a store and forward mechanism
anyway with no guaranteed delivery.
You probably need to read up a little on messaging. As Guru also said
a JMS server would meet your needs.
There's generally a JMS server built into most app servers or you can
plug one in if it doesn't have one. A good list at:
http://mule.codehaus.org/display/MULE/Configuring+Jms
I've used ActiveMQ before and it's quite stable/reliable. It's run
for a few months without problems (though not under heavy load), YMMV.
HTH
Oz
> Can I really get a mail session and send from within an action?
> Doesnt that assume I am threading the process? When would this
> breakdown? At 100/hr or 1000/hr? Thank you.
>
> Oguz Kologlu wrote: yes, The main issue
> will response times if you a send emails
> synchronously ( if you can you send async). Async will definitely
> scale better since the client isn't blocking a thread for nothing.
> Simultaneous clients should be no problem as long as you follow the
> same threading rules as everything else shared vars etc.
>
> For high loads you should use messaging. There's a ton of stuff on
> the net about async programming but it really depends on your
> environment. For a full JEE setup I'd probably use a Message Driven
> Bean. What sort of volume are you looking at and what's the
> environment?
>
> Oz
>
>
> On 25/06/2007, at 9:35 PM, Chris Pat wrote:
>
>> Hello
>> Is it possible to send an email within an action? How/What are the
>> issues? Is this scalable? How does it play with the framework and
>> multiple simultaneous clients? Any insight would be appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: email within action
Posted by Oguz Kologlu <oz...@optusnet.com.au>.
On 25/06/2007, at 10:33 PM, Chris Pat wrote:
> Hello
> How can I send the email asynchronously? My timeframe is the
> lifecycle of the action and my browser session.
Well you will probably not be doing the emailing async but rather
firing off an async request to send an email ( eg send "hello world"
to this list of 1000 recipients) and response to the client (ie
browser) that the emails are going out. You really don't have to wait
for an email to be sent since email is a store and forward mechanism
anyway with no guaranteed delivery.
You probably need to read up a little on messaging. As Guru also said
a JMS server would meet your needs.
There's generally a JMS server built into most app servers or you can
plug one in if it doesn't have one. A good list at:
http://mule.codehaus.org/display/MULE/Configuring+Jms
I've used ActiveMQ before and it's quite stable/reliable. It's run
for a few months without problems (though not under heavy load), YMMV.
HTH
Oz
> Can I really get a mail session and send from within an action?
> Doesnt that assume I am threading the process? When would this
> breakdown? At 100/hr or 1000/hr? Thank you.
>
> Oguz Kologlu <oz...@optusnet.com.au> wrote: yes, The main issue
> will response times if you a send emails
> synchronously ( if you can you send async). Async will definitely
> scale better since the client isn't blocking a thread for nothing.
> Simultaneous clients should be no problem as long as you follow the
> same threading rules as everything else shared vars etc.
>
> For high loads you should use messaging. There's a ton of stuff on
> the net about async programming but it really depends on your
> environment. For a full JEE setup I'd probably use a Message Driven
> Bean. What sort of volume are you looking at and what's the
> environment?
>
> Oz
>
>
> On 25/06/2007, at 9:35 PM, Chris Pat wrote:
>
>> Hello
>> Is it possible to send an email within an action? How/What are the
>> issues? Is this scalable? How does it play with the framework and
>> multiple simultaneous clients? Any insight would be appreciated.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: email within action
Posted by Chris Pat <cp...@yahoo.com>.
Hello
How can I send the email asynchronously? My timeframe is the lifecycle of the action and my browser session. Can I really get a mail session and send from within an action? Doesnt that assume I am threading the process? When would this breakdown? At 100/hr or 1000/hr? Thank you.
Oguz Kologlu <oz...@optusnet.com.au> wrote: yes, The main issue will response times if you a send emails
synchronously ( if you can you send async). Async will definitely
scale better since the client isn't blocking a thread for nothing.
Simultaneous clients should be no problem as long as you follow the
same threading rules as everything else shared vars etc.
For high loads you should use messaging. There's a ton of stuff on
the net about async programming but it really depends on your
environment. For a full JEE setup I'd probably use a Message Driven
Bean. What sort of volume are you looking at and what's the environment?
Oz
On 25/06/2007, at 9:35 PM, Chris Pat wrote:
> Hello
> Is it possible to send an email within an action? How/What are the
> issues? Is this scalable? How does it play with the framework and
> multiple simultaneous clients? Any insight would be appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: email within action
Posted by Oguz Kologlu <oz...@optusnet.com.au>.
yes, The main issue will response times if you a send emails
synchronously ( if you can you send async). Async will definitely
scale better since the client isn't blocking a thread for nothing.
Simultaneous clients should be no problem as long as you follow the
same threading rules as everything else shared vars etc.
For high loads you should use messaging. There's a ton of stuff on
the net about async programming but it really depends on your
environment. For a full JEE setup I'd probably use a Message Driven
Bean. What sort of volume are you looking at and what's the environment?
Oz
On 25/06/2007, at 9:35 PM, Chris Pat wrote:
> Hello
> Is it possible to send an email within an action? How/What are the
> issues? Is this scalable? How does it play with the framework and
> multiple simultaneous clients? Any insight would be appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: email within action
Posted by "Raghupathy, Gurumoorthy" <Gu...@nielsen.com>.
Sending email involves a lot of processing ....
If I was you then I would rather use JMS to send emails (so that you can
send email asynchronously)...
Your action send a message to a JMS server to send email with details
and then that's it...
The MDB bean will scan the queue and then send the email one by one ...
Regards
Guru
-----Original Message-----
From: Chris Pat [mailto:cpanon@yahoo.com]
Sent: 25 June 2007 12:35
To: Struts Users Mailing List
Subject: email within action
Hello
Is it possible to send an email within an action? How/What are the
issues? Is this scalable? How does it play with the framework and
multiple simultaneous clients? Any insight would be appreciated.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org