Scalable Messaging is the the need of the enterprise messaging infrastructure. JBossA-MQ is one of the leading products for scalable messaging. It also covers some common concepts beween Apache Active MQ and JBoss A-MQ . Apache Camel as a integration framework supports the enterprise messaging greately and the presentation also contains some of its areas of adjunction to Scalable messaging with queues and topics.
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.
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
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
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
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
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
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