• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of SLSB

 
Francesco A
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,

i'm working on SCEA part II and i'm wondering if a SLSB can be used to send Email or to open a HTTP connection with other external system.

I was looking around in the books but i didn't find anything.
Is there anyone that has this kind of experience to explain to me if i can do that?
Thanks in advace.
Frankie A.
 
Mat Williams
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ya,

A SLSB can be used to send an email and also open a http connection to a remote host. It can not be used to list for Http connections from other hosts - this is not permitted by the spec I believe.

I am not sure that I would recommend using a SLSB to open an http connection to a remote host, but you can do it.

Mat
 
Francesco A
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you,

so if i get it correctly i should use a POJO to manage a HTTP connection.
Is this right?
 
Cleuton Sampaio
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It is just a suggestion, but how about use a MessageDriven bean to send emails? It is not necessary to send emails synchronously, so, why waste resources waiting for the email server to process your request?

You post a message to a queue and then the MDB can get it and send an email message using javamail.
 
Francesco A
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, i could use MDB to send an email message but what if the message sent is a part of biggertransition?

In other word i should send the email during a transition and if the message sending fails the transition should fail too.
Of course when i say fail i mean that the bean can't contact the mail server for example.
Thanks
 
Cleuton Sampaio
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the message sending fails, you could not confirm the message aknowledgement and it will be queued again. Later on you can try to send it again.
 
Babji Reddy
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using http connecttions in SLSB is a very valid scenario. Thats what the soap calls to webservices to under the wire..
Sending emails synchronously requires high resource availability, as the ejb container sometimes might timeout if the smtp server is busy. Adjusting the timeout is also not advisable.
MDB could be a better solution. The SLSB client can poll (or PULL) the SLSB which can use JMS API to check the failure messages in the same queue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic