Professional Documents
Culture Documents
By
Azrul MADISA
Freelance Java Developer
azrulhasni@gmail.com
Plat du jour
The concurrent
enterprise
The next billion users
Asynchronous
messaging
Enter Scala
Scala concurrency
Scala actors
Scala and Message
Driven Beans
The ever concurrent
enterprise
Service B
Service B
Service B
Service C
Service C
Service C
Service D Service D
Service D
Queue up Queue up
(1 counter in (Many counters
the shop) In the shop)
Inventory
Packaging
Pay and delivery
Pay
Telco
Switch board → Exchanges →
NGN
Government
Counter based → E-Government
Finance
Counter → ATM → E-Banking
Others
Millitary, logistics, media &
content
The next billion users
Sum of Bandwidth:
Google, Twitter,
Facebook etc.
*Prise (Enterprise)
Cloud based, Saas,
* http://blogs.sun.com/Gregp/entry/a_word_or_two_on
Don't mean to scare ya
but...
People are more network centric
Every mobile device is a potential
terminal to your services
How many mobile devices are
there?
A couple of billion ?
People are not the only ones
accessing your services
[Please hum the X-Files theme
song in your head right now]
=> Computing demand grows
faster than Moore's law
Also known as the red shift
One word to rule them all
...
One word to rule them all
...
i t y
i l
a b
a l
S c
What technology will allow
this?
Criteria
Play well with current enterprise
systems
Play well on the JVM
Fault tolerent
Share-nothing philosophy
Asynchronous messaging
No side effect (Maybe functional)
Easy to learn (tool support, language
LAF)
Performance – At least as good as
current offerings
Take advantage of multi-core tech.
Why asynchronous
messaging important
E-commerce example:
Verify
stock
User choose Go to
Start
products checkout
Stock exist?
Take payment
Yes End
from user
Why asynchronous
messaging important
Verify stock
Millions of items
Kicker... need to lock
an item while
reserving it
To avoid 2 person
buying the same
thing
Lengthy => Clients
will run away
Why asynchronous
messaging important
Simplified e-
End
commerce
User choose Go to Take payment
Start
products checkout from user
Why asynchronous
messaging important
Simplified e-
End
commerce
User choose Go to Take payment
Start
products checkout from user
Yes Packaging +
End
Shipment
Short OLTP
High volume
processes
We somewhat know
how to do this
High volume
Long running
processes ?
Long running transaction
Client pay
Package an item
Ship to client's
premise
Client pay
Package an item
Reimburse 80%
Back to client
Exception!
Ship to client's
premise
Ship back to
Client cancel vendor's premise
MainApp End
Yes Packaging +
End
Shipment
`
Combining actors and
message driven beans
Scala Actors Message driven bean
Request
Actor javax.jms.MessageListener
Queue
WormholeActor
MDB
Lift
Scala web framework based on
actors
Scala books
Testing
ScalaTest
References