By Ramakrishna Narkedamilli
Overview:
Apache ActiveMQ is the most popular and powerful open source messaging and
Integration Patterns server.
Apache ActiveMQ is fast, supports many Cross Language Clients. Using this we can
enable to message throttling, redelivery, delay of messages.
In this Presentation will going to see
 ActiveMQ Installation and configurations
 DeadLetter queue configuration
 Configuring ActiveMQ in clusters
 Running ActiveMQ in clusters
ActiveMQ Installation and configurations:
Prerequisites
 ActiveMQ installer -- apache-activemq-5.8.0-bin.zip
 Database:- Microsoft SQL Server
Limitations:
The configuration is done in activemq.xml and the configuration tags used in the
code works with apache-activemq version 5.8.0.It might change according to latest
versions.
Steps to Install
 Extract apache-activemq-5.8.0-bin.zip to a folder eg:- Applications where it will be
running
 It will create the folder apache-activemq-5.8.0 in the Applications folder
 Go to the folder <apache-activemq-5.8.0bins> and start the activemq.bat file
 The ActiveMq server will be started and will be running.
 Enter the address in the browser :- http://localhost:8161/admin
 Enter the user name and password as admin , admin
DeadLetter queue configuration:
To configure DeadLetter Queue in activeMQ:-
 Go to the folder <apache-activemq-5.8.0conf>
 Open the file activemq.xml in an editor.
 Modify the following in the file :-
 Set the following code in the redeliveryPolicyMap:-
<redeliveryPolicyEntries>
<redeliveryPolicy queue=">" maximumRedeliveries="1"
redeliveryDelay="1200000" initialRedeliveryDelay="5000"
useCollisionAvoidance="true" />
</redeliveryPolicyEntries>
 Enter the following tags:-
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="localhost " dataDirectory="${activemq.data}" persistent="true">
 Here maximumRedeliveries is the number of redeliveries of the messages,
redeliveryDelay is the interval of messages to be delivered and
initialRedeliveryDelay is the interval which the messages will be triggered for the
first time.
 Here brokerName needs to be mentioned.
 The above script will set the redeliveryPolicies.
 Note:-The queue will not be created until messages are pushed in ActiveMQ.
 Open Mule and run the consumer program to consume the messages from
ActiveMQ.
 Once the data is pushed from SAP the ActiveMQ will create the queue and stores
the messages.
 Now whenever the consumer throws an exception, The messages will retry to a
certain time based on redelivery policy of ActiveMQ and a deadletter queue will
be created and failed messages will be pushed to the deadletter queue.
Configuring ActiveMQ in clusters:
Clustering is needed so that if 1 node(master) goes down then the other
nodes(slaves) can take the work from it and the data should always be available.
Steps to Install and configure ActiveMQ in clusters:-
 Let there be 2 nodes which we want to configure in cluster.
 Repeat the installing and configuring of ActiveMQ on both systems which would
be in clusters.
 Need to install Microsoft SQL Server on one of the systems that are in clusters.
 Now open the activemq.xml file of ActiveMQ from <apache-activemq-5.8.0conf>
folder.
 Change the broker name.Note:- The broker name should be different for both the
nodes:-
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="Node1 "
dataDirectory="${activemq.data}" persistent="true">
 Enter the following tag below to bean class tag in the file:-
 Add the following tags inside persistenceAdapter tag:-
<bean id="sql-ds"
class="org.apache.commons.dbcp.BasicDataSource" destroy-
method="close">
<property
name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="url"
value="jdbc:sqlserver://=%ipaddress%SQLEXPRESS:1433;databaseNa
me=SOA_VMES"/>
<property name="username"
value="username"/>
<property name="password"
value="samplepassword"/>
<property name="maxActive"
value="200"/>
<property
name="poolPreparedStatements" value="true"/>
</bean>
<jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data"
dataSource="#sql-ds" useDatabaseLock="true" lockKeepAlivePeriod="5000"/>
 Remove the kahaDB tag from persistenceAdapter tag.
 Copy the sqljdbc4.jar file in activemq lib folder if it is not there.
 Give different web app port numbers in different nodes.(For ex :node1->8161 &
node->8162)
 Change port number in transportConnector tag in activemq.xml file in node2.
 (for ex node1 give 61616 & for node2 give 62626).
 Note: - useDatabaseLock="true" should always be true
 Here driverClassName is the name of the database driver.
 url is the url of the SQL server with the database name.
 username and password are the username and password for the database
 dataSource is the the name of the data source we are configuring in the database
configuration.
 Now go to the next clustered node and open the activemq.xml file of ActiveMQ
from <apache-activemq-5.8.0conf> folder
 Repeat the same configuration and both the ActiveMQ are in clustered
 Note here in this node the broker name need to be changed
 Rest everything in the configuration file of the second node will be same as it is.
 Note there should be a database named SOA_VMES in the SQL server which the
ActiveMQ will use for clustering.
 The database should be one which will be using by both the clusters. The database
should be installed in any one of the node.
<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="Node2 " dataDirectory="${activemq.data}"
persistent="true">
Running ActiveMQ in clusters:
 Go to node1 which is the first node in the cluster. This node will act as master.
 Go to the folder <apache-activemq-5.8.0bins> and start the activemq.bat file
 The ActiveMQ node1 server will be started and will act as a Master node
 Enter the address in the browser :- http://localhost:8161/admin
 Enter the user name and password as admin , admin
 Click the Queue in the portal to view the queue messages in the ActiveMQ
 Currently there will be no messages and following screen will appear
 Goto node2 and repeat the same process to start activeMQ server
 Now both the nodes are running in clusters.
 Node2 will start but since Node2 is a slave it will not be activated and wait for the
control of the database due to database lock. Check the screenshots below:-
Node2 ActiveMQ server is waiting for the database lock to be release. If we open
the browser in node2 and enter http://localhost:8162/admin, it will not display
anything since it is not activated.
 For Testing purpose, push the messages to Master (Node1) server using some Java
code or Mule ESB flows.
 Stop the master instance.
 Slave instance will pick the lock from database immediately and gets the messages
from Node1
 Open the browser http://localhost:8162/admin.
 You can able to see messages that has been received from Master node.
THANKS YOU
By Ramakrishna Narkedamilli

More Related Content

PPT
Burns
PPT
Hypopituitarism & Hyperpituitarism
PPTX
hypospadias
PDF
Reproductive System Pathology_FM Breast and FM Reproductive Systems
PDF
history taking Clinical assessment of endocrine system 2022.pdf
PPT
Lec # 2 special population revised
PDF
Advanced messaging with Apache ActiveMQ
Burns
Hypopituitarism & Hyperpituitarism
hypospadias
Reproductive System Pathology_FM Breast and FM Reproductive Systems
history taking Clinical assessment of endocrine system 2022.pdf
Lec # 2 special population revised
Advanced messaging with Apache ActiveMQ

Viewers also liked (14)

PPTX
Messaging for Web and Mobile with Apache ActiveMQ
PDF
ActiveMQ In Action
PPT
ActiveMQ 5.9.x new features
PDF
Messaging With ActiveMQ
PDF
IoT with Apache ActiveMQ, Camel & Spark
PPTX
Enterprise mobility
PPT
Enterprise Integration Patterns with ActiveMQ
PDF
A Practical Guide for Selecting an Enterprise Messaging Platforms
PDF
Active MQ
PDF
Messaging With Apache ActiveMQ
PDF
Connecting Applications Everywhere with ActiveMQ
PDF
Websphere MQ (MQSeries) fundamentals
PDF
Queue Management
PPTX
JMS Providers Overview
Messaging for Web and Mobile with Apache ActiveMQ
ActiveMQ In Action
ActiveMQ 5.9.x new features
Messaging With ActiveMQ
IoT with Apache ActiveMQ, Camel & Spark
Enterprise mobility
Enterprise Integration Patterns with ActiveMQ
A Practical Guide for Selecting an Enterprise Messaging Platforms
Active MQ
Messaging With Apache ActiveMQ
Connecting Applications Everywhere with ActiveMQ
Websphere MQ (MQSeries) fundamentals
Queue Management
JMS Providers Overview
Ad

Similar to Active mq Installation and Master Slave setup (20)

PPTX
Activemq installation and master slave setup using shared broker data
PDF
Creating MQ Clister
PPTX
Active mq read and write flow in mule
PPTX
Integration Of Mulesoft and Apache Active MQ
PDF
Bpug mcollective 20140624
PPTX
ActiveMQ interview Questions and Answers
PDF
Fault tolerant and scalable ibm mq
PDF
IBM MQ Basics
PPT
Apache ActiveMQ - Enterprise messaging in action
PDF
IBM MQ Clustering (2017 version)
PPTX
Spring JMS and ActiveMQ
PDF
IBM IMPACT 2014 AMC-1866 Introduction to IBM Messaging Capabilities
PPTX
19 08-22 introduction to activeMQ
PDF
Enterprise Messaging With ActiveMQ and Spring JMS
PDF
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
PPTX
Hhm 3479 mq clustering and shared queues for high availability
PPTX
Jms queue
PDF
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
PPTX
M messaging 2
PPTX
Jms queues
Activemq installation and master slave setup using shared broker data
Creating MQ Clister
Active mq read and write flow in mule
Integration Of Mulesoft and Apache Active MQ
Bpug mcollective 20140624
ActiveMQ interview Questions and Answers
Fault tolerant and scalable ibm mq
IBM MQ Basics
Apache ActiveMQ - Enterprise messaging in action
IBM MQ Clustering (2017 version)
Spring JMS and ActiveMQ
IBM IMPACT 2014 AMC-1866 Introduction to IBM Messaging Capabilities
19 08-22 introduction to activeMQ
Enterprise Messaging With ActiveMQ and Spring JMS
IBM IMPACT 2014 - AMC-1882 Building a Scalable & Continuously Available IBM M...
Hhm 3479 mq clustering and shared queues for high availability
Jms queue
Alvaro Videla, Building a Distributed Data Ingestion System with RabbitMQ
M messaging 2
Jms queues
Ad

More from Ramakrishna Narkedamilli (9)

PPTX
Enabling Security For ActiveMQ JMX Access
PPTX
Mule Requester Usage Demo
PPTX
Mule Integration with Dropbox
PPTX
Mule ESB integration with Stripe
PPTX
Mule integration with Servicenow
PPTX
Custom connector development using mule DevKit
PPTX
Mule Integration with Atlassian JIRA
PPTX
MMC control for failing flows consistently
PPTX
Salesforce Integration Using javacode
Enabling Security For ActiveMQ JMX Access
Mule Requester Usage Demo
Mule Integration with Dropbox
Mule ESB integration with Stripe
Mule integration with Servicenow
Custom connector development using mule DevKit
Mule Integration with Atlassian JIRA
MMC control for failing flows consistently
Salesforce Integration Using javacode

Recently uploaded (20)

PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PPTX
observCloud-Native Containerability and monitoring.pptx
DOCX
search engine optimization ppt fir known well about this
PDF
Unlock new opportunities with location data.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
CloudStack 4.21: First Look Webinar slides
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
Hybrid model detection and classification of lung cancer
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Getting Started with Data Integration: FME Form 101
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Chapter 5: Probability Theory and Statistics
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
Tartificialntelligence_presentation.pptx
PDF
Taming the Chaos: How to Turn Unstructured Data into Decisions
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Group 1 Presentation -Planning and Decision Making .pptx
1 - Historical Antecedents, Social Consideration.pdf
observCloud-Native Containerability and monitoring.pptx
search engine optimization ppt fir known well about this
Unlock new opportunities with location data.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
CloudStack 4.21: First Look Webinar slides
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
Hybrid model detection and classification of lung cancer
Zenith AI: Advanced Artificial Intelligence
DP Operators-handbook-extract for the Mautical Institute
Developing a website for English-speaking practice to English as a foreign la...
Getting Started with Data Integration: FME Form 101
A review of recent deep learning applications in wood surface defect identifi...
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Chapter 5: Probability Theory and Statistics
A contest of sentiment analysis: k-nearest neighbor versus neural network
Tartificialntelligence_presentation.pptx
Taming the Chaos: How to Turn Unstructured Data into Decisions

Active mq Installation and Master Slave setup

  • 2. Overview: Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server. Apache ActiveMQ is fast, supports many Cross Language Clients. Using this we can enable to message throttling, redelivery, delay of messages. In this Presentation will going to see  ActiveMQ Installation and configurations  DeadLetter queue configuration  Configuring ActiveMQ in clusters  Running ActiveMQ in clusters
  • 3. ActiveMQ Installation and configurations: Prerequisites  ActiveMQ installer -- apache-activemq-5.8.0-bin.zip  Database:- Microsoft SQL Server Limitations: The configuration is done in activemq.xml and the configuration tags used in the code works with apache-activemq version 5.8.0.It might change according to latest versions.
  • 4. Steps to Install  Extract apache-activemq-5.8.0-bin.zip to a folder eg:- Applications where it will be running  It will create the folder apache-activemq-5.8.0 in the Applications folder  Go to the folder <apache-activemq-5.8.0bins> and start the activemq.bat file  The ActiveMq server will be started and will be running.  Enter the address in the browser :- http://localhost:8161/admin  Enter the user name and password as admin , admin
  • 5. DeadLetter queue configuration: To configure DeadLetter Queue in activeMQ:-  Go to the folder <apache-activemq-5.8.0conf>  Open the file activemq.xml in an editor.  Modify the following in the file :-  Set the following code in the redeliveryPolicyMap:- <redeliveryPolicyEntries> <redeliveryPolicy queue=">" maximumRedeliveries="1" redeliveryDelay="1200000" initialRedeliveryDelay="5000" useCollisionAvoidance="true" /> </redeliveryPolicyEntries>  Enter the following tags:- <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost " dataDirectory="${activemq.data}" persistent="true">
  • 6.  Here maximumRedeliveries is the number of redeliveries of the messages, redeliveryDelay is the interval of messages to be delivered and initialRedeliveryDelay is the interval which the messages will be triggered for the first time.  Here brokerName needs to be mentioned.  The above script will set the redeliveryPolicies.  Note:-The queue will not be created until messages are pushed in ActiveMQ.  Open Mule and run the consumer program to consume the messages from ActiveMQ.  Once the data is pushed from SAP the ActiveMQ will create the queue and stores the messages.
  • 7.  Now whenever the consumer throws an exception, The messages will retry to a certain time based on redelivery policy of ActiveMQ and a deadletter queue will be created and failed messages will be pushed to the deadletter queue.
  • 8. Configuring ActiveMQ in clusters: Clustering is needed so that if 1 node(master) goes down then the other nodes(slaves) can take the work from it and the data should always be available. Steps to Install and configure ActiveMQ in clusters:-  Let there be 2 nodes which we want to configure in cluster.  Repeat the installing and configuring of ActiveMQ on both systems which would be in clusters.  Need to install Microsoft SQL Server on one of the systems that are in clusters.  Now open the activemq.xml file of ActiveMQ from <apache-activemq-5.8.0conf> folder.  Change the broker name.Note:- The broker name should be different for both the nodes:- <broker xmlns="http://activemq.apache.org/schema/core" brokerName="Node1 " dataDirectory="${activemq.data}" persistent="true">
  • 9.  Enter the following tag below to bean class tag in the file:-  Add the following tags inside persistenceAdapter tag:- <bean id="sql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy- method="close"> <property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> <property name="url" value="jdbc:sqlserver://=%ipaddress%SQLEXPRESS:1433;databaseNa me=SOA_VMES"/> <property name="username" value="username"/> <property name="password" value="samplepassword"/> <property name="maxActive" value="200"/> <property name="poolPreparedStatements" value="true"/> </bean> <jdbcPersistenceAdapter dataDirectory="${activemq.base}/activemq-data" dataSource="#sql-ds" useDatabaseLock="true" lockKeepAlivePeriod="5000"/>
  • 10.  Remove the kahaDB tag from persistenceAdapter tag.  Copy the sqljdbc4.jar file in activemq lib folder if it is not there.  Give different web app port numbers in different nodes.(For ex :node1->8161 & node->8162)  Change port number in transportConnector tag in activemq.xml file in node2.  (for ex node1 give 61616 & for node2 give 62626).  Note: - useDatabaseLock="true" should always be true  Here driverClassName is the name of the database driver.  url is the url of the SQL server with the database name.  username and password are the username and password for the database  dataSource is the the name of the data source we are configuring in the database configuration.  Now go to the next clustered node and open the activemq.xml file of ActiveMQ from <apache-activemq-5.8.0conf> folder  Repeat the same configuration and both the ActiveMQ are in clustered
  • 11.  Note here in this node the broker name need to be changed  Rest everything in the configuration file of the second node will be same as it is.  Note there should be a database named SOA_VMES in the SQL server which the ActiveMQ will use for clustering.  The database should be one which will be using by both the clusters. The database should be installed in any one of the node. <broker xmlns="http://activemq.apache.org/schema/core" brokerName="Node2 " dataDirectory="${activemq.data}" persistent="true">
  • 12. Running ActiveMQ in clusters:  Go to node1 which is the first node in the cluster. This node will act as master.  Go to the folder <apache-activemq-5.8.0bins> and start the activemq.bat file  The ActiveMQ node1 server will be started and will act as a Master node
  • 13.  Enter the address in the browser :- http://localhost:8161/admin  Enter the user name and password as admin , admin  Click the Queue in the portal to view the queue messages in the ActiveMQ  Currently there will be no messages and following screen will appear
  • 14.  Goto node2 and repeat the same process to start activeMQ server  Now both the nodes are running in clusters.  Node2 will start but since Node2 is a slave it will not be activated and wait for the control of the database due to database lock. Check the screenshots below:- Node2 ActiveMQ server is waiting for the database lock to be release. If we open the browser in node2 and enter http://localhost:8162/admin, it will not display anything since it is not activated.
  • 15.  For Testing purpose, push the messages to Master (Node1) server using some Java code or Mule ESB flows.  Stop the master instance.  Slave instance will pick the lock from database immediately and gets the messages from Node1  Open the browser http://localhost:8162/admin.  You can able to see messages that has been received from Master node.