SlideShare uma empresa Scribd logo
1 de 49
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

Mais conteúdo relacionado

Mais procurados

Muletransformers
MuletransformersMuletransformers
Muletransformersvijaynerd
 
An Introduction to Apache ServiceMix 4 - FUSE ESB
An Introduction to Apache ServiceMix 4 - FUSE ESBAn Introduction to Apache ServiceMix 4 - FUSE ESB
An Introduction to Apache ServiceMix 4 - FUSE ESBAdrian Trenaman
 
ActiveMQ In Action
ActiveMQ In ActionActiveMQ In Action
ActiveMQ In ActionBruce Snyder
 
Connecting applicationswitha mq
Connecting applicationswitha mqConnecting applicationswitha mq
Connecting applicationswitha mqRob Davies
 
Wso2 integration platform deep dive eu con 2016
Wso2 integration platform deep dive   eu con 2016Wso2 integration platform deep dive   eu con 2016
Wso2 integration platform deep dive eu con 2016Chanaka Fernando
 
Enterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSEnterprise Messaging With ActiveMQ and Spring JMS
Enterprise Messaging With ActiveMQ and Spring JMSBruce Snyder
 
Wso2 esb-maintenance-guide
Wso2 esb-maintenance-guideWso2 esb-maintenance-guide
Wso2 esb-maintenance-guideChanaka Fernando
 
Mule JMS Transport
Mule JMS TransportMule JMS Transport
Mule JMS TransportRupesh Sinha
 
Wso2 con eu 2016 an introduction to the wso2 integration platform by chanak...
Wso2 con eu 2016   an introduction to the wso2 integration platform by chanak...Wso2 con eu 2016   an introduction to the wso2 integration platform by chanak...
Wso2 con eu 2016 an introduction to the wso2 integration platform by chanak...Chanaka Fernando
 
Mule enterprise service bus
Mule enterprise service busMule enterprise service bus
Mule enterprise service busThang Loi
 
Anypoint mq queues and exchanges
Anypoint mq queues and exchangesAnypoint mq queues and exchanges
Anypoint mq queues and exchangesSon Nguyen
 
Introduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisIntroduction to Apache ActiveMQ Artemis
Introduction to Apache ActiveMQ ArtemisYoshimasa Tanabe
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaMax Alexejev
 
Do we need JMS in 21st century?
Do we need JMS in 21st century?Do we need JMS in 21st century?
Do we need JMS in 21st century?Mikalai Alimenkou
 
JMS Providers Overview
JMS Providers OverviewJMS Providers Overview
JMS Providers OverviewVadym Lotar
 
Introduction to WSO2 ESB Pass-Through Transport
Introduction to WSO2 ESB Pass-Through TransportIntroduction to WSO2 ESB Pass-Through Transport
Introduction to WSO2 ESB Pass-Through TransportChanaka Fernando
 

Mais procurados (20)

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

Semelhante a JUDCon2014-ScalableMessagingWithJBossA-MQ and Apache Camel

Planning for MQ in the cloud MQTC 2017
Planning for MQ in the cloud MQTC 2017Planning for MQ in the cloud MQTC 2017
Planning for MQ in the cloud MQTC 2017Robert Parker
 
What's new in IBM MQ, March 2018
What's new in IBM MQ, March 2018What's new in IBM MQ, March 2018
What's new in IBM MQ, March 2018David Ware
 
Membase Meetup 2010
Membase Meetup 2010Membase Meetup 2010
Membase Meetup 2010Membase
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Guido Schmutz
 
Understanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIsUnderstanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIsKenneth Peeples
 
Running IBM MQ in the Cloud
Running IBM MQ in the CloudRunning IBM MQ in the Cloud
Running IBM MQ in the CloudRobert Parker
 
StarlingX - Driving Compute to the Edge with OpenStack
StarlingX - Driving Compute to the Edge with OpenStackStarlingX - Driving Compute to the Edge with OpenStack
StarlingX - Driving Compute to the Edge with OpenStackStacy Véronneau
 
Microsoft Azure Cloud Basics Tutorial
Microsoft Azure Cloud Basics TutorialMicrosoft Azure Cloud Basics Tutorial
Microsoft Azure Cloud Basics TutorialIIMSE Edu
 
Dimension data cloud for the enterprise architect
Dimension data cloud for the enterprise architectDimension data cloud for the enterprise architect
Dimension data cloud for the enterprise architectDavid Sawatzke
 
ActiveMQ interview Questions and Answers
ActiveMQ interview Questions and AnswersActiveMQ interview Questions and Answers
ActiveMQ interview Questions and Answersjeetendra mandal
 
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...Kai Wähner
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon Web Services Korea
 
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsMessaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsJohn Staveley
 
AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...
AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...
AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...Amazon Web Services
 
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWSArquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWSAmazon Web Services LATAM
 
IBM Intro to Using MQ with WAS and Liberty
IBM Intro to Using MQ with WAS and LibertyIBM Intro to Using MQ with WAS and Liberty
IBM Intro to Using MQ with WAS and LibertyIBM Systems UKI
 

Semelhante a JUDCon2014-ScalableMessagingWithJBossA-MQ and Apache Camel (20)

Planning for MQ in the cloud MQTC 2017
Planning for MQ in the cloud MQTC 2017Planning for MQ in the cloud MQTC 2017
Planning for MQ in the cloud MQTC 2017
 
What's new in IBM MQ, March 2018
What's new in IBM MQ, March 2018What's new in IBM MQ, March 2018
What's new in IBM MQ, March 2018
 
Membase Meetup 2010
Membase Meetup 2010Membase Meetup 2010
Membase Meetup 2010
 
Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !Apache Kafka - Scalable Message-Processing and more !
Apache Kafka - Scalable Message-Processing and more !
 
Understanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIsUnderstanding and Using Client JBoss A-MQ APIs
Understanding and Using Client JBoss A-MQ APIs
 
Running IBM MQ in the Cloud
Running IBM MQ in the CloudRunning IBM MQ in the Cloud
Running IBM MQ in the Cloud
 
StarlingX - Driving Compute to the Edge with OpenStack
StarlingX - Driving Compute to the Edge with OpenStackStarlingX - Driving Compute to the Edge with OpenStack
StarlingX - Driving Compute to the Edge with OpenStack
 
Microsoft Azure Cloud Basics Tutorial
Microsoft Azure Cloud Basics TutorialMicrosoft Azure Cloud Basics Tutorial
Microsoft Azure Cloud Basics Tutorial
 
Dimension data cloud for the enterprise architect
Dimension data cloud for the enterprise architectDimension data cloud for the enterprise architect
Dimension data cloud for the enterprise architect
 
ActiveMQ interview Questions and Answers
ActiveMQ interview Questions and AnswersActiveMQ interview Questions and Answers
ActiveMQ interview Questions and Answers
 
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
Architecture patterns for distributed, hybrid, edge and global Apache Kafka d...
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
 
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure FunctionsMessaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
Messaging - RabbitMQ, Azure (Service Bus), Docker and Azure Functions
 
AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...
AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...
AWS re:Invent 2016: How to Launch a 100K-User Corporate Back Office with Micr...
 
Introduction To Cloud Computing
Introduction To Cloud ComputingIntroduction To Cloud Computing
Introduction To Cloud Computing
 
TechTalkThai-CiscoHyperFlex
TechTalkThai-CiscoHyperFlexTechTalkThai-CiscoHyperFlex
TechTalkThai-CiscoHyperFlex
 
IBM MQ vs Apache ActiveMQ
IBM MQ vs Apache ActiveMQIBM MQ vs Apache ActiveMQ
IBM MQ vs Apache ActiveMQ
 
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWSArquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
Arquitetura Hibrida - Integrando seu Data Center com a Nuvem da AWS
 
IBM Intro to Using MQ with WAS and Liberty
IBM Intro to Using MQ with WAS and LibertyIBM Intro to Using MQ with WAS and Liberty
IBM Intro to Using MQ with WAS and Liberty
 
Picking a message queue
Picking a  message queuePicking a  message queue
Picking a message queue
 

Último

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

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