SlideShare a Scribd company logo
1
Scalable messaging with
JBoss A-MQ and Camel
Bhavani Ananth
@bhavani_an
in.linkedin.com/in/bhavaniananth/
2
Naveen Raj Balasubramaniam
@Naveenrajbala
in.linkedin.com/in/naveenraj/
Messaging And Integration
JBoss A-MQ
JBoss A-MQ – Protocols
JBoss A-MQ – Message Stores
Vertical and Horizontal Scalability
3
Camel in brief!
Agenda
Messaging And Integration
4
Scalable Solution
5
Large Retail Industry
Billing Go Online Vendor
Inventory Warehouse Logistics
Integration Infrastructure
MessagingMessaging
Messaging
Messaging
MessagingMessaging
Data Is Growing
Every Second –
Data Deluge
More Data Due to
Emergence of
Internet Of Things
Need For A
Scalable Solution
What do we have!
Red Hat JBoss A-MQ
7
JBoss A-MQ
8
What is JBoss A-MQ
9
JMS 1.1-compliant messaging system based on
Apache Active MQ.
Consists of a broker and client-side libraries enabling
remote communication among distributed client
applications.
Architecture and Features
10
JBoss-AMQ
Apache Karaf + Fuse Fabric
Monitoring
and
Management
Apache Active MQ
STOMP MQTT
Open Wire AMQP NMS
JMS
JBoss A-MQ – Protocols
11
Protocols Supported
12
Client API’s
JMS
NMS
CMS
Rest/Ajax
Wire
Protocols
MQTT
AMQP
STOMP
Open Wire
Transports
TCP/SSL
HTTP/HTTPS
WS/WSS
MQTT
MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol.
URI- mqtt://Host:[Port]?transportOptions
13
Facebook Messenger Smart Santander Features
Open
Simple
Works well in
constrained networks
AMQP
Features
 Multi-Vendor
interoperability
 Highly reliable
 Feature rich
AMQP (Advanced Message Queueing Protocol) is an openly published wire
specification for asynchronous messaging
URI: “amqp:// Host:[Port]?transportOptions
14
STOMP
STOMP is the Simple (or Streaming) Text Orientated Messaging Protocol.
URI: “stomp://localhost:61613”
15
Broker
Producer
STOMP
Consumer
(Ruby,PHP)
TCP
Features
 Simple
 Used in scripting
languages
Openwire
Features
Default wire format used by ActiveMQ.
Efficient
Supports auto reconnect
Supports client failover
OpenWire is the cross language Wire Protocol to allow native access to ActiveMQ from
a number of different languages and platforms
16
JBoss A-MQ – Message
Stores
17
Message Stores
KahaDB message store
Distributed KahaDB message store
LevelDB message store – the best in terms of
scalability and performance
Journaled JDBC adapter
Non-journaled JDBC adapter
18
Message Broker
Message Cursors
Message Store and Message cursors in an Retail
Infrastructure
19
Vendor
Systems
System A
System B
Inventory
System
Message Store
App
Queue 2
Dispatch queue Pending Cursor
App
Queue
1
App
Queue 3
Queue impl
details
Message Broker
Message Cursors – Increase Scalability of
Message Stores
Store Based cursors for fast Consumers (Retail Scenario)
20
Dispatch
Queue
Pending
Cursor
Message Store
Inbound
Messages
Vendor
Systems
System A
System B
Store Based cursors for slow Consumers
Message Cursors – Increase Scalability of
Message Stores Contd…
21
Message Broker
Dispatch
Queue
Pending
Cursor
Message Store
Inbound
Messages
Vendor
Systems
System A
System B
VMCursors
Message Cursors – Increase Scalability of
Message Stores Contd…
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
<pendingQueuePolicy> <vmQueueCursor/> </pendingQueuePolicy>
</policyEntry>
22
Message Broker
Dispatch
Queue
Pending
Cursor
Message Store
Inbound
Messages
Vendor
Systems
System A
System B
File Based Cursors
•Does not scale well if the consumers are behind by a large margin
•Used for non persistent messages
Message Cursors – Increase Scalability of
Message Stores Contd…
23
Message Broker
Dispatch
Queue
Pending
Cursor
Message Store
Inbound
Messages
File Based Cursors
Temporary
Files
Vendor
Systems
System A
System B
Vertical and Horizontal
Scalability
24
Vertical Scalability
 Capacity of a single broker to support large numbers of connections from
consumers and producers.
 To Consider
 Thread Count
 CPU Usage
 Memory Usage
25
Vertical Scalability – Reducing Thread Count
NIO protocol
<transportConnectors>
<transportConnector name="nio" uri="nio://0.0.0.0:61616"/>
</<transportConnectors>
26
JBoss A-MQ – Vertical Scalability – Reducing
Thread Count
Disable Dedicated Task Runner
ACTIVEMQ_OPTS="-org.apache.activemq.UseDedicatedTaskRunner=false“
Use optimized dispatch for queues
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry topic=">" optimizedDispatch="true">
...
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
27
Vertical Scalability – CPU
Enable tightEncodingEnabled
uri = "failover://(tcp://localhost:61616wireFormat.tightEncodingEnabled=false)";
Enabling compression
tcp://hostA:61617?jms.useCompression=true
28
Vertical Scalability – Memory
Allocate more memory to broker
• pass the –Xmx option to the JVM.
ACTIVEMQ_OPTS="-Xmx2048M -Dorg.apache.activemq.UseDedicatedTaskRunner=false“
Configure big enough memory usage
<systemUsage>
<memoryUsage>
<memoryUsage limit="1024 mb" />
</memoryUsage>
</systemUsage>
29
Horizontal Scalability – Network of Brokers
Concepts
Network Connector
Transport Connector
Store and Forward
30
Broker-1
Broker-2
Network
Connector
Producer
Transport
Connector
Consumer
Transport
Connector
Retail Example – Hub and Spoke Topology
31
Store and Forward-
Configuration
Store Store
Retail
Outlet
Ware
house
Fire
wall
<networkConnectors>
<networkConnector
uri="static:(tcp://warehouse:61617)"
userName="admin" password="admin“
duplex=“true”
conduitSubscriptions=“true”
decreaseNetworkConsumerPriorit
y=“false” />
</networkConnectors>
When there are a lot of producers
Brokers, A, B, and C, accept
connections from message producers.
Brokers, X and Y, accept connections
from message consumers.
Concentrator Topology - Producer Load
Balancing
33
A B C
YX
C1 C2 C3 C4
Some Other Topologies
34
 Tree Topology
Graph Topology
Mesh Topology
Retail Example-High
Availability
Shared
Store
Retail
Master
Broker
Retail
Slave
Broker
Wareh
ouse
Slave
Broker
Wareh
ouse
Master
Broker
Shared
Store
Network
Connection on
Failure
Network
Connection
<networkConnectors>
<networkConnector
uri="static:(tcp://retail-
master:61617, tcp://retail-
slave:61617)"
</networkConnectors>
<services>
<masterConnector
remoteURI=“tcp://retail-
slave:62001”
userName=“admin”
password=“admin”/>
</services>
Other Master Slave Topologies
Master
Broker
Slave
Broker
Store Store
Message
Shared Nothing Master Slave
Reliable
Only one slave possible
Downtime when master fails
Client
36
Shared Storage Master-Slave
Master
Broker with
file lock
Slave
Broker
Shared File
System or
SAN
Shared File system Master Slave
Recommended if SAN is
available
Easy to configure
No restriction on the slaves
Client
Slave
Broker
Slave polls for
lock
37
Hybrid Scaling
38
Client
Acc
Payable
Master
Acc
Payable
Slave
Accounts Payable
Information
Acc
Receivabl
e Master
Acc
Receivabl
e Slave
Accounts
Receivable
Information
 Client Complexity
 Less broker cross
talk
Apache Camel
A ride to solve your integration problems
39
Camel-What is it
Open source integration framework
Based on Enterprise Integration Patterns(EIPs)
Supports more than 120+ components
Supports DSL programming with Spring, Java, Scala and groovy
Flexible deployment
Can run standalone with maven
40
CBR Wire Tap TransformationEndpoint Translator
Camel-Architecture
41
Camel Coding Structure
import org.apache.camel.builder.RouteBuilder;
public class MyRouteBuilder extends RouteBuilder {
public void configure() {
from("file:SourceFolder?noop=true")
.to("file:TargetFolder");
}
}
<camelContext
xmlns="http://camel.apache.org/schema/spring">
<route id=“FileToFile">
<from uri="file:SourceFolder?noop=true""/>
<to uri="mock:inside"/>
</route>
</camelContext>
Java DSL
Spring DSL
42
Read a file from
SourceFolder and write it to
TargetFolder
43
<route>
<from
uri="activemq:JUDCon?destination.consumer.exclusive=true&amp;destinati
on.consumer.prefetchSize=50"/>
<to uri="mock:2014"/>
</route>
Routes
Camel and Messaging
Configuring the Destination Options at the Endpoint in the
Routes
Camel and Messaging Contd…
<bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61616" />
</bean>
Beans
44
<bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="jmsConfig"/>
<property name="transacted" value="true"/>
<property name="cacheLevelName" value="CACHE_CONSUMER" />
</bean>
<bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
<property name= "maxConnections" value="8" />
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="pooledConnectionFactory"/>
<property name="concurrentConsumers" value="10“ />
</bean>
Camel – Scalability Techniques
45
Throttle
Load
Balancing
from("activemq:queueA").throttle(10).
to("activemq:queueB")
<from uri=" activemq:queueA " />
<throttle maximumRequestsPerPeriod="3“>
<to uri=" activemq:queueB " />
from(" activemq:queueA ").
loadBalance().roundRobin().
to(" activemq:queueB ",
" activemq:queueC",
" activemq:queueD");
<from uri=" activemq:queueA "/>
<loadBalance>
<roundRobin/>
<to uri=" activemq:queueB"/>
<to uri=" activemq:queueC "/>
<to uri=" activemq:queueD "/>
</loadBalance>
46
Embedding Camel into Your Broker
• Reduces serialization cost
• Reduced networkWhy?
• Using Interceptors to your
brokerWhen?
• Add the camel route to
activemq.xmlHow?
Summary
• Messaging and Integration
• Significance of Asynchronous messaging
• How scalability is important to solve large flow of data
• Scalability – Vertical and Horizontal
• What's camel and Integration
47
Useful Links
References
• http://camel.apache.org/architecture.html
• http://camel.apache.org/jms.html
• http://activemq.apache.org/broker-camel-component.html
48
Thank You
Scale Your Enterprise ECO System
49
@bhavani_an @Naveenrajbala

More Related Content

ODP
Red Hat Open Day JBoss Fuse
PDF
Apache ActiveMQ and Apache ServiceMix
PDF
Messaging With ActiveMQ
PDF
Connecting Applications Everywhere with ActiveMQ
PDF
Syer Monitoring Integration And Batch
PPT
Implementing WebServices with Camel and CXF in ServiceMix
PPT
WebServices in ServiceMix with CXF
PPT
Apache ActiveMQ - Enterprise messaging in action
Red Hat Open Day JBoss Fuse
Apache ActiveMQ and Apache ServiceMix
Messaging With ActiveMQ
Connecting Applications Everywhere with ActiveMQ
Syer Monitoring Integration And Batch
Implementing WebServices with Camel and CXF in ServiceMix
WebServices in ServiceMix with CXF
Apache ActiveMQ - Enterprise messaging in action

What's hot (20)

PPTX
Muletransformers
PPT
An Introduction to Apache ServiceMix 4 - FUSE ESB
PDF
Advaced training-wso2-esb
PDF
ActiveMQ In Action
PPT
Connecting applicationswitha mq
PDF
Wso2 integration platform deep dive eu con 2016
PPTX
Mule rabbitmq
PPTX
Making Apache Camel work for you
PDF
Enterprise Messaging With ActiveMQ and Spring JMS
PDF
Wso2 esb-maintenance-guide
PPTX
Mule JMS Transport
PDF
Wso2 con eu 2016 an introduction to the wso2 integration platform by chanak...
PPT
Mule enterprise service bus
PPTX
Anypoint mq queues and exchanges
PDF
Introduction to Apache ActiveMQ Artemis
PPT
Distributed & Highly Available server applications in Java and Scala
PDF
Mini-Training: Message Brokers
PPTX
Do we need JMS in 21st century?
PPTX
JMS Providers Overview
PDF
Introduction to WSO2 ESB Pass-Through Transport
Muletransformers
An Introduction to Apache ServiceMix 4 - FUSE ESB
Advaced training-wso2-esb
ActiveMQ In Action
Connecting applicationswitha mq
Wso2 integration platform deep dive eu con 2016
Mule rabbitmq
Making Apache Camel work for you
Enterprise Messaging With ActiveMQ and Spring JMS
Wso2 esb-maintenance-guide
Mule JMS Transport
Wso2 con eu 2016 an introduction to the wso2 integration platform by chanak...
Mule enterprise service bus
Anypoint mq queues and exchanges
Introduction to Apache ActiveMQ Artemis
Distributed & Highly Available server applications in Java and Scala
Mini-Training: Message Brokers
Do we need JMS in 21st century?
JMS Providers Overview
Introduction to WSO2 ESB Pass-Through Transport
Ad

Similar to JUDCon2014-ScalableMessagingWithJBossA-MQ and Apache Camel (20)

PDF
Camel oneactivemq posta-final
PPTX
High powered messaging with RabbitMQ
PDF
Toulouse Java User Group
PDF
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
PDF
AMQP with RabbitMQ
PDF
Enterprise Messaging with Apache ActiveMQ
PDF
IBM IMPACT 2014 AMC-1866 Introduction to IBM Messaging Capabilities
PDF
Message Driven Beans (6)
PDF
Messaging With Apache ActiveMQ
PPTX
PDF
The Future of Messaging: RabbitMQ and AMQP
PPTX
Jms using j boss
PPTX
WMQ, WMB and EIP
PDF
Polyglot Messaging with Apache ActiveMQ
KEY
Integration and Batch Processing on Cloud Foundry
PDF
London JBUG - Connecting Applications Everywhere with JBoss A-MQ
PPTX
Enterprise Integration Patterns and Apache Camel
PDF
Spring integration
PPTX
Jms deep dive [con4864]
Camel oneactivemq posta-final
High powered messaging with RabbitMQ
Toulouse Java User Group
Architecture | The Future of Messaging: RabbitMQ and AMQP | Eberhard Wolff
AMQP with RabbitMQ
Enterprise Messaging with Apache ActiveMQ
IBM IMPACT 2014 AMC-1866 Introduction to IBM Messaging Capabilities
Message Driven Beans (6)
Messaging With Apache ActiveMQ
The Future of Messaging: RabbitMQ and AMQP
Jms using j boss
WMQ, WMB and EIP
Polyglot Messaging with Apache ActiveMQ
Integration and Batch Processing on Cloud Foundry
London JBUG - Connecting Applications Everywhere with JBoss A-MQ
Enterprise Integration Patterns and Apache Camel
Spring integration
Jms deep dive [con4864]
Ad

Recently uploaded (20)

PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Modernizing your data center with Dell and AMD
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Modernizing your data center with Dell and AMD
Network Security Unit 5.pdf for BCA BBA.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Monthly Chronicles - July 2025
Electronic commerce courselecture one. Pdf
Spectral efficient network and resource selection model in 5G networks
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

JUDCon2014-ScalableMessagingWithJBossA-MQ and Apache Camel

  • 1. 1
  • 2. Scalable messaging with JBoss A-MQ and Camel Bhavani Ananth @bhavani_an in.linkedin.com/in/bhavaniananth/ 2 Naveen Raj Balasubramaniam @Naveenrajbala in.linkedin.com/in/naveenraj/
  • 3. Messaging And Integration JBoss A-MQ JBoss A-MQ – Protocols JBoss A-MQ – Message Stores Vertical and Horizontal Scalability 3 Camel in brief! Agenda
  • 5. Scalable Solution 5 Large Retail Industry Billing Go Online Vendor Inventory Warehouse Logistics Integration Infrastructure MessagingMessaging Messaging Messaging MessagingMessaging
  • 6. Data Is Growing Every Second – Data Deluge More Data Due to Emergence of Internet Of Things Need For A Scalable Solution
  • 7. What do we have! Red Hat JBoss A-MQ 7
  • 9. What is JBoss A-MQ 9 JMS 1.1-compliant messaging system based on Apache Active MQ. Consists of a broker and client-side libraries enabling remote communication among distributed client applications.
  • 10. Architecture and Features 10 JBoss-AMQ Apache Karaf + Fuse Fabric Monitoring and Management Apache Active MQ STOMP MQTT Open Wire AMQP NMS JMS
  • 11. JBoss A-MQ – Protocols 11
  • 13. MQTT MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. URI- mqtt://Host:[Port]?transportOptions 13 Facebook Messenger Smart Santander Features Open Simple Works well in constrained networks
  • 14. AMQP Features  Multi-Vendor interoperability  Highly reliable  Feature rich AMQP (Advanced Message Queueing Protocol) is an openly published wire specification for asynchronous messaging URI: “amqp:// Host:[Port]?transportOptions 14
  • 15. STOMP STOMP is the Simple (or Streaming) Text Orientated Messaging Protocol. URI: “stomp://localhost:61613” 15 Broker Producer STOMP Consumer (Ruby,PHP) TCP Features  Simple  Used in scripting languages
  • 16. Openwire Features Default wire format used by ActiveMQ. Efficient Supports auto reconnect Supports client failover OpenWire is the cross language Wire Protocol to allow native access to ActiveMQ from a number of different languages and platforms 16
  • 17. JBoss A-MQ – Message Stores 17
  • 18. Message Stores KahaDB message store Distributed KahaDB message store LevelDB message store – the best in terms of scalability and performance Journaled JDBC adapter Non-journaled JDBC adapter 18
  • 19. Message Broker Message Cursors Message Store and Message cursors in an Retail Infrastructure 19 Vendor Systems System A System B Inventory System Message Store App Queue 2 Dispatch queue Pending Cursor App Queue 1 App Queue 3 Queue impl details
  • 20. Message Broker Message Cursors – Increase Scalability of Message Stores Store Based cursors for fast Consumers (Retail Scenario) 20 Dispatch Queue Pending Cursor Message Store Inbound Messages Vendor Systems System A System B
  • 21. Store Based cursors for slow Consumers Message Cursors – Increase Scalability of Message Stores Contd… 21 Message Broker Dispatch Queue Pending Cursor Message Store Inbound Messages Vendor Systems System A System B
  • 22. VMCursors Message Cursors – Increase Scalability of Message Stores Contd… <policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb"> <pendingQueuePolicy> <vmQueueCursor/> </pendingQueuePolicy> </policyEntry> 22 Message Broker Dispatch Queue Pending Cursor Message Store Inbound Messages Vendor Systems System A System B
  • 23. File Based Cursors •Does not scale well if the consumers are behind by a large margin •Used for non persistent messages Message Cursors – Increase Scalability of Message Stores Contd… 23 Message Broker Dispatch Queue Pending Cursor Message Store Inbound Messages File Based Cursors Temporary Files Vendor Systems System A System B
  • 25. Vertical Scalability  Capacity of a single broker to support large numbers of connections from consumers and producers.  To Consider  Thread Count  CPU Usage  Memory Usage 25
  • 26. Vertical Scalability – Reducing Thread Count NIO protocol <transportConnectors> <transportConnector name="nio" uri="nio://0.0.0.0:61616"/> </<transportConnectors> 26
  • 27. JBoss A-MQ – Vertical Scalability – Reducing Thread Count Disable Dedicated Task Runner ACTIVEMQ_OPTS="-org.apache.activemq.UseDedicatedTaskRunner=false“ Use optimized dispatch for queues <destinationPolicy> <policyMap> <policyEntries> <policyEntry topic=">" optimizedDispatch="true"> ... </policyEntry> </policyEntries> </policyMap> </destinationPolicy> 27
  • 28. Vertical Scalability – CPU Enable tightEncodingEnabled uri = "failover://(tcp://localhost:61616wireFormat.tightEncodingEnabled=false)"; Enabling compression tcp://hostA:61617?jms.useCompression=true 28
  • 29. Vertical Scalability – Memory Allocate more memory to broker • pass the –Xmx option to the JVM. ACTIVEMQ_OPTS="-Xmx2048M -Dorg.apache.activemq.UseDedicatedTaskRunner=false“ Configure big enough memory usage <systemUsage> <memoryUsage> <memoryUsage limit="1024 mb" /> </memoryUsage> </systemUsage> 29
  • 30. Horizontal Scalability – Network of Brokers Concepts Network Connector Transport Connector Store and Forward 30 Broker-1 Broker-2 Network Connector Producer Transport Connector Consumer Transport Connector
  • 31. Retail Example – Hub and Spoke Topology 31
  • 32. Store and Forward- Configuration Store Store Retail Outlet Ware house Fire wall <networkConnectors> <networkConnector uri="static:(tcp://warehouse:61617)" userName="admin" password="admin“ duplex=“true” conduitSubscriptions=“true” decreaseNetworkConsumerPriorit y=“false” /> </networkConnectors>
  • 33. When there are a lot of producers Brokers, A, B, and C, accept connections from message producers. Brokers, X and Y, accept connections from message consumers. Concentrator Topology - Producer Load Balancing 33 A B C YX C1 C2 C3 C4
  • 34. Some Other Topologies 34  Tree Topology Graph Topology Mesh Topology
  • 36. Other Master Slave Topologies Master Broker Slave Broker Store Store Message Shared Nothing Master Slave Reliable Only one slave possible Downtime when master fails Client 36
  • 37. Shared Storage Master-Slave Master Broker with file lock Slave Broker Shared File System or SAN Shared File system Master Slave Recommended if SAN is available Easy to configure No restriction on the slaves Client Slave Broker Slave polls for lock 37
  • 38. Hybrid Scaling 38 Client Acc Payable Master Acc Payable Slave Accounts Payable Information Acc Receivabl e Master Acc Receivabl e Slave Accounts Receivable Information  Client Complexity  Less broker cross talk
  • 39. Apache Camel A ride to solve your integration problems 39
  • 40. Camel-What is it Open source integration framework Based on Enterprise Integration Patterns(EIPs) Supports more than 120+ components Supports DSL programming with Spring, Java, Scala and groovy Flexible deployment Can run standalone with maven 40 CBR Wire Tap TransformationEndpoint Translator
  • 42. Camel Coding Structure import org.apache.camel.builder.RouteBuilder; public class MyRouteBuilder extends RouteBuilder { public void configure() { from("file:SourceFolder?noop=true") .to("file:TargetFolder"); } } <camelContext xmlns="http://camel.apache.org/schema/spring"> <route id=“FileToFile"> <from uri="file:SourceFolder?noop=true""/> <to uri="mock:inside"/> </route> </camelContext> Java DSL Spring DSL 42 Read a file from SourceFolder and write it to TargetFolder
  • 44. Camel and Messaging Contd… <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL" value="tcp://localhost:61616" /> </bean> Beans 44 <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="configuration" ref="jmsConfig"/> <property name="transacted" value="true"/> <property name="cacheLevelName" value="CACHE_CONSUMER" /> </bean> <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop"> <property name= "maxConnections" value="8" /> <property name="connectionFactory" ref="jmsConnectionFactory" /> </bean> <bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration"> <property name="connectionFactory" ref="pooledConnectionFactory"/> <property name="concurrentConsumers" value="10“ /> </bean>
  • 45. Camel – Scalability Techniques 45 Throttle Load Balancing from("activemq:queueA").throttle(10). to("activemq:queueB") <from uri=" activemq:queueA " /> <throttle maximumRequestsPerPeriod="3“> <to uri=" activemq:queueB " /> from(" activemq:queueA "). loadBalance().roundRobin(). to(" activemq:queueB ", " activemq:queueC", " activemq:queueD"); <from uri=" activemq:queueA "/> <loadBalance> <roundRobin/> <to uri=" activemq:queueB"/> <to uri=" activemq:queueC "/> <to uri=" activemq:queueD "/> </loadBalance>
  • 46. 46 Embedding Camel into Your Broker • Reduces serialization cost • Reduced networkWhy? • Using Interceptors to your brokerWhen? • Add the camel route to activemq.xmlHow?
  • 47. Summary • Messaging and Integration • Significance of Asynchronous messaging • How scalability is important to solve large flow of data • Scalability – Vertical and Horizontal • What's camel and Integration 47
  • 48. Useful Links References • http://camel.apache.org/architecture.html • http://camel.apache.org/jms.html • http://activemq.apache.org/broker-camel-component.html 48
  • 49. Thank You Scale Your Enterprise ECO System 49 @bhavani_an @Naveenrajbala