Scalable Integration with JBoss Fuse
- 2. Agenda
• Background
– JBoss
Fuse
– JBoss
Data
Grid
• When
size
and
&me
does
ma<er
• Technical
Details
• Hands-‐on
– 11:45
done
- 4. Heavy
LiGing
Class
MyFileReader{
….
while
((line=reader.readLine())
!
=
null)
{
writer.write(line);
writer.newLine();
//
Write
system
dependent
end
of
line.
}
……
}
Class
MyJAXBConverter{
…..
JAXBContext.newInstanceUnm
arshaller
unmarshaller
=
jc.createUnmarshaller();
unmarshaller.unmarshal(xml);
marshaller.setProperty(Marshal
ler.JAXB_FORMATTED_OUTPUT
,
true);
….}
Class
JMSConnector{
…..
Connec&onFactory
connec&onFactory
=
null;Des&na&on
dest
=
null;try
{
connec&onFactory
=
(Connec&onFactory)
jndiContext.lookup("jms/
Connec&onFactory");
dest
=
(Des&na&on)
jndiContext.lookup(destName);
}}
catch
(Excep&on
e)
….}
Class
Appraiser{
…..
if(houseInfo
!=
null){
appraisedValue
+=
houseInfo.getLandSize()*
1000
appraisedValue
+=
houseInfo.getBathroom()
*
2000;
appraisedValue
+=
houseInfo.getBedroom()
*
2500;
houseInfo.setAppraisedValue(
appraisedValue);….}
etc...
- 7. JBoss
Data
Grid
Applica&on
RDBMS
In-Memory
Cache
Applica&on
In-Memory
Cache
Applica&on
In-Memory
Cache
Applica&on
In-Memory
Cache
Applica&on
In-Memory
Cache
Applica&on
In-Memory
Cache
- 8. JBoss
Data
Grid
Applica&on
Applica&on
Applica&on
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
In-Memory
Cache
- 11. When
SIZE
and
TIME
does
ma<er
!!??
JBoss
Fuse
&
JBoss
Data
Grid
- 12. Large
amount
of
Data
• Incoming
data
• Processing
Data
• Providing
output
- 14. Incoming
data
Integra&on
Service
Integra&on
Service
Integra&on
Service
- 17. Providing
output
• Publish
and
subscribe(Topic)
in
messaging
• Caching
medium
- 19. Setup
JDG
• Setup
Data
Grid
in
Fuse
<bean id="cacheManager"
class="org.infinispan.manager.DefaultCacheManager"!
! !init-method="start" destroy-method="stop">!
!<argument value="infinispan.xml" />!
</bean>!
- 20. Setups
• In
infinispan.xml
<transport>
<proper&es>
<property
name="configura*onFile"
value="jgroups-‐tcp-‐sample.xml"/>
</proper&es>
</transport>
<namedCache
name="stock-‐file-‐cache">
<jmxSta&s&cs
enabled="true"/>
<clustering
mode="replica*on">
<async/>
</clustering>
<evic&on
maxEntries="30"
strategy="FIFO"/>
</namedCache>
- 22. Camel
Endpoint
for
JDG
• Component
for
JDG
infinispan
– URI
uses
host
and
port
for
remote(hotrod)
endpoints.
<to uri="infinispan://localhost:11222?
cacheName=ConversationCache"/>!
JBoss
Fuse
JDG
- 23. CAMEL-‐JBOSSDATAGRID
COMPONENT
Producer
are
for
PUT,
GET,
REMOVE
or
CLEAR
commands
<to
uri="infinispan://localhost?command=GET"/>
Consumers
are
listeners
for
different
eventTypes
(library
mode
only)
<from
uri="infinispan://foo?cacheContainer=#cacheManager"/>
- 24. Camel
Endpoint
for
JDG
• Uses
header
parameters
for
keys
and
values
JDG
CamelInfinispanKey
CamelInfinispanValue
- 25. Semng
up
JDG
in
Camel
<!-- Setup DataGrid in Fuse -->!
<bean id="cacheManager" !
class="org.infinispan.manager.DefaultCacheManager"!
! ! init-method="start" destroy-method="stop">!
!<argument value="infinispan.xml" />!
</bean>!
<service ref="cacheManager"
interface="org.infinispan.manager.EmbeddedCacheManager" />!
Fuse
OSGi
container
cacheManager
- 28. Stock
Market
Broker
A
stock
market
broker
needs
to
provide
it's
brokers
with
historical
data
of
past
stock
close
value,
and
show
how
much
will
earn
if
customer
sell
their
stock
today.
- 31. The
incoming
data
Stock
Symbol
Orders
Customer
Customer
Customer
Customer
Customer
Customer
Customer
Integra&on
Service
Get
All
Historical
Order
value
Get
All
Historical
Data
- 32. TASK
ONE
–
Claim
Check
Pa<ern
Stock
Symbol
Orders
Customer
Customer
Customer
Customer
Customer
Customer
JDG
Stock
Symbol
- 33. TASK
TWO
–
Process
Historical
Data
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
JDG
- 34. TASK
Three–
Remote
Event
Listener
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
Daily
Stock
quote
JDG
Client
Listener