Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Unclear about this ...

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I studying Jasmine example from Mastering EJB book.
there is a MDB called OrderProcessorBean, the onMessage( ) method of this bean contains a comment from the authors which says :
" At this point, we could perform lots of tasks:
A call-out to a credit card company (perhaps through web services) to check the user's credit card rating and perform a debit. "
assume the following scenario :
we have a session bean that will send a message to the queue that OrderProcessorBean is listening to.
this MDB will use the information contained in the message to invoke a web service that will try to check the credit card of the user.
maybe the credit card is invalid, how can the session bean knows that ?
I think it is impossible since the messaging is asynchronous, there is no way that will allow the session bean to know this ...
someone shed some light here ?
thanks.
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct that if the session bean needs to know the response, then using an MDB to charge the card will not work. However, I just ordered an LCD (finally found a decent stackable coupon for the Dell 20.1" yay!) monitor, but my card won't be charged until the order is processed and and ready to ship. If it fails, I assume they'll cancel the order and send me a nasty email. The point is that sometimes immediacy isn't necessary.

Given that you'd probably at least verify the card and reserve the charge against it, this may be a bad example, but it's still valid.
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic