{"id":26236,"date":"2014-06-10T22:00:54","date_gmt":"2014-06-10T19:00:54","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=26236"},"modified":"2014-06-10T12:40:02","modified_gmt":"2014-06-10T09:40:02","slug":"activemq-network-of-brokers-explained-part-5","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html","title":{"rendered":"ActiveMQ &#8211; Network of Brokers Explained &#8211; Part 5"},"content":{"rendered":"<p>In the previous <a href=\"http:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-4.html\">part 4<\/a> we have seen how to load balance remote consumers on a queue using network connectors.<\/p>\n<p>In this part 5, we will see how the same configuration would work if we had concurrent remote durable subscribers on a topic. \u00a0Consider the following configuration&#8230;.<\/p>\n<p>&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/part-5-lb-rcc-New-Page1.png\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26367\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/part-5-lb-rcc-New-Page1.png\" alt=\"part-5-lb-rcc - New Page\" width=\"400\" height=\"211\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Fig 1: Network of Brokers &#8211; Load balance subscribers on a topic<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nAs shown above, we have Broker-1 which initiates two network connectors to Broker-2 and Broker-3. A producer sends messages to a topic &#8220;moo.bar&#8221; on Broker-1 while Broker-2 has subscriber C1 and Broker-3 has two subscribers C2 and C3 on the same topic &#8220;moo.bar&#8221;.<\/p>\n<p>You may observe that this set up is very similar to <a href=\"http:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-4.html\">part 4<\/a>. The only difference is that here we are dealing with topics while in<a href=\"http:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-4.html\"> part 4<\/a>, we were dealing with queues.<\/p>\n<h2>Let&#8217;s see this in action<\/h2>\n<ol>\n<li>Add the following network connector configuration in Broker-1&#8217;s activemq.xml configuration file:\n<pre class=\"brush:xml\">  &lt;networkConnectors&gt;\r\n&lt;networkConnector\r\nname=\"T:broker1-&gt;broker2\"\r\nuri=\"static:(tcp:\/\/localhost:61626)\"\r\nduplex=\"false\"\r\ndecreaseNetworkConsumerPriority=\"false\"\r\nnetworkTTL=\"2\"\r\nconduitSubscriptions=\"false\"\r\ndynamicOnly=\"true\"&gt;\r\n&lt;excludedDestinations&gt;\r\n&lt;queue physicalName=\"&gt;\" \/&gt;\r\n&lt;\/excludedDestinations&gt;\r\n&lt;\/networkConnector&gt;\r\n&lt;networkConnector\r\nname=\"T:broker1-&gt;broker3\"\r\nuri=\"static:(tcp:\/\/localhost:61636)\"\r\nduplex=\"false\"\r\ndecreaseNetworkConsumerPriority=\"false\"\r\nnetworkTTL=\"2\"\r\nconduitSubscriptions=\"false\"\r\ndynamicOnly=\"true\"&gt;\r\n&lt;excludedDestinations&gt;\r\n&lt;queue physicalName=\"&gt;\" \/&gt;\r\n&lt;\/excludedDestinations&gt;\r\n&lt;\/networkConnector&gt;\r\n&lt;\/networkConnectors&gt;<\/pre>\n<\/li>\n<li>Let&#8217;s start broker-2, broker-3 and broker-1 in that order.<\/li>\n<li>\n<pre class=\"brush:bash\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/cluster\/broker-2\/bin$ .\/broker-2 console<\/pre>\n<\/li>\n<li>\n<pre class=\"brush:bash\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/cluster\/broker-3\/bin$ .\/broker-3 console<\/pre>\n<\/li>\n<li>\n<pre class=\"brush:bash\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/cluster\/broker-1\/bin$ .\/broker-1 console<\/pre>\n<\/li>\n<li>Broker-1&#8217;s admin console connections show that two network connectors have been established as configured from Broker-1 to Broker-2 and Broker-3 respectively:<\/li>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-connections1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26368\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-connections1.jpg\" alt=\"broker-1-connections\" width=\"400\" height=\"53\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-connections1.jpg 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-connections1-300x39.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-connections1-1024x135.jpg 1024w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Broker-1&#8217;s Connections @\u00a0http:\/\/localhost:8161\/admin\/connections.jsp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<li>Let&#8217;s start the subscriber C1 on Broker-2 subscribing to messages to topic &#8220;moo.bar&#8221; and subscribers C2 and C3 on Broker-3 subscribing to messages on same topic &#8220;moo.bar&#8221;.<\/li>\n<li>Durable Subscribers require unique combination of client id and subscriber name. In order for us to create durable subscribers C2 and C3 we need to enhance the functionality provided in \/Users\/akuntamukkala\/apache-activemq-5.8.0\/example\/src\/ConsumerTool.java where\u00a0\/Users\/akuntamukkala\/apache-activemq-5.8.0 is the directory where ActiveMQ is installed.<\/li>\n<li>The modified code consists of editing build.xml and ConsumerTool.java to add a new parameter &#8220;subscriberName&#8221;. The edited files build.xml and ConsumerTool.java can be obtained from\u00a0<a href=\"https:\/\/drive.google.com\/file\/d\/0B6UoSlNMfxQOdmpCVXhxT0dNaGc\/edit?usp=sharing\" target=\"_blank\">here<\/a>\u00a0and\u00a0<a href=\"https:\/\/drive.google.com\/file\/d\/0B6UoSlNMfxQOMDc5R3V5VzRJS3M\/edit?usp=sharing\" target=\"_blank\">here<\/a>\u00a0respectively.<\/li>\n<li>Let&#8217;s start the subscribers now.<\/li>\n<li>\n<pre class=\"brush:bash;wrap-lines:false\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/example$ <b>ant consumer -Durl=tcp:\/\/localhost:61626 -Dtopic=true -Dsubject=moo.bar -DclientId=C1 -Ddurable=true -DsubscriberName=mb.C1<\/b><\/pre>\n<\/li>\n<li>\n<pre class=\"brush:bash;wrap-lines:false\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/example$ <b>ant consumer -Durl=tcp:\/\/localhost:61636 -Dtopic=true -Dsubject=moo.bar -DclientId=C2 -Ddurable=true -DsubscriberName=mb.C2<\/b><\/pre>\n<\/li>\n<li>\n<pre class=\"brush:bash;wrap-lines:false\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/example$ <b>ant consumer -Durl=tcp:\/\/localhost:61636 -Dtopic=true -Dsubject=moo.bar -DclientId=C3 -Ddurable=true -DsubscriberName=mb.C3<\/b><\/pre>\n<\/li>\n<li>Durable subscriber on Broker-2:<br \/>\n&nbsp;<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-2-durable-subscribers1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26369\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-2-durable-subscribers1.jpg\" alt=\"broker-2-durable-subscribers\" width=\"640\" height=\"84\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>http:\/\/localhost:9161\/admin\/subscribers.jsp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;\n<\/li>\n<li>Durable subscribers on Broker-3:<br \/>\n&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-durable-subscribers1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26370\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-durable-subscribers1.jpg\" alt=\"broker-3-durable-subscribers\" width=\"640\" height=\"107\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-durable-subscribers1.jpg 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-durable-subscribers1-300x50.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-durable-subscribers1-1024x173.jpg 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>http:\/\/localhost:10161\/admin\/subscribers.jsp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/li>\n<li>Durable subscribers on Broker-1 (because of network connectors):<br \/>\n&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/3.bp.blogspot.com\/-vnJcgh5YfVQ\/U4bTNSiLMqI\/AAAAAAAAAU4\/K5g0RYgYzSU\/s1600\/broker-1-durable-subscribers.tiff\"><img decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-vnJcgh5YfVQ\/U4bTNSiLMqI\/AAAAAAAAAU4\/K5g0RYgYzSU\/s1600\/broker-1-durable-subscribers.tiff\" alt=\"\" width=\"640\" height=\"120\" border=\"0\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>http:\/\/localhost:8161\/admin\/subscribers.jsp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;\n<\/li>\n<li>\u00a0Now let&#8217;s send 10 durable messages to topic moo.bar on Broker-1.<\/li>\n<li>\n<pre class=\"brush:bash;wrap-lines:false\"> akuntamukkala@localhost~\/apache-activemq-5.8.0\/example$ <b>ant producer -Durl=tcp:\/\/localhost:61616 -Dtopic=true -Dsubject=moo.bar -Dmax=10 -Ddurable=true<\/b><\/pre>\n<\/li>\n<li>See the console on Broker-3:<br \/>\n&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-duplicate-msg-warning.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26372\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-duplicate-msg-warning.jpg\" alt=\"broker-3-duplicate-msg-warning\" width=\"640\" height=\"99\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Log file output on Broker-3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;\n<\/li>\n<li>As you may observe, Broker-3 receives the same message twice, once per each subscription C2 and C3. <b>ActiveMQ by default does not permit processing of duplicate messages.<\/b><\/li>\n<li><i>This happens because both the subscriptions mb.C2 and mb.C3 on Broker-3 are propagated to Broker-1. So when 10 messages are published to moo.bar on Broker-1, those messages are sent over to subscribers mb.C2 and mb.C3 on the same broker: Broker-3. Since the messages have the same ID, duplicate messages are discarded and hence the warning shown in the log messages&#8230;.(shown in step 19).<\/i><\/li>\n<li>Here is the console showing statistics on Broker-1:<br \/>\n&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-stats.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26373\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-stats.jpg\" alt=\"broker-1-stats\" width=\"640\" height=\"122\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-stats.jpg 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-stats-300x57.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-stats-1024x197.jpg 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>http:\/\/localhost:8161\/admin\/subscribers.jsp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/li>\n<li>Here is the console showing statistics on Broker-3:<br \/>\n&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-stats.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26374\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-stats.jpg\" alt=\"broker-3-stats\" width=\"640\" height=\"106\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-stats.jpg 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-stats-300x49.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-stats-1024x169.jpg 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>http:\/\/localhost:10161\/admin\/subscribers.jsp<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/li>\n<li>As you can see even though the enqueue counter shows 20, the dequeue counter shows only 10, since the other 10 messages were discarded by the Broker-3. <i>This is a useful feature which helps to ensure that a message gets processed at most once by a broker.<\/i><\/li>\n<\/ol>\n<p>The reason why this is occurring is because both subscriptions C2 and C3 are propagated to upstream broker Broker-1.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-duplicate-msg-warning1.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26375\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-duplicate-msg-warning1.jpg\" alt=\"broker-3-duplicate-msg-warning1\" width=\"640\" height=\"348\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Duplicate Messages on Broker-3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nLet&#8217;s retry the same scenario using a minor tweak in the network connector settings by making <b>conduitSubscriptions=&#8221;true&#8221;<\/b><br \/>\non both network connectors from Broker-1 to Broker-2 and Broker-3 respectively. After restarting the brokers, delete the inactive durable subscribers and then repeat the above steps.<\/p>\n<pre class=\"brush:xml\">  &lt;networkConnectors&gt;\r\n&lt;networkConnector\r\nname=\"T:broker1-&gt;broker2\"\r\nuri=\"static:(tcp:\/\/localhost:61626)\"\r\nduplex=\"false\"\r\ndecreaseNetworkConsumerPriority=\"false\"\r\nnetworkTTL=\"2\"\r\nconduitSubscriptions=\"true\"\r\ndynamicOnly=\"true\"&gt;\r\n&lt;excludedDestinations&gt;\r\n&lt;queue physicalName=\"&gt;\" \/&gt;\r\n&lt;\/excludedDestinations&gt;\r\n&lt;\/networkConnector&gt;\r\n&lt;networkConnector\r\nname=\"T:broker1-&gt;broker3\"\r\nuri=\"static:(tcp:\/\/localhost:61636)\"\r\nduplex=\"false\"\r\ndecreaseNetworkConsumerPriority=\"false\"\r\nnetworkTTL=\"2\"\r\nconduitSubscriptions=\"true\"\r\ndynamicOnly=\"true\"&gt;\r\n&lt;excludedDestinations&gt;\r\n&lt;queue physicalName=\"&gt;\" \/&gt;\r\n&lt;\/excludedDestinations&gt;\r\n&lt;\/networkConnector&gt;\r\n&lt;\/networkConnectors&gt;\r\n\r\n\r\n<\/pre>\n<p>The following screenshot shows that Broker-1 now sees only two durable subscribers, one from each broker, \u00a0Broker-2 and Broker-3.<\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-cs-true.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26376\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-cs-true.jpg\" alt=\"broker-1-cs-true\" width=\"640\" height=\"99\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Durable Subscribers in Broker-1 when conduitSubscriptions=&#8221;true&#8221;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>Upon publishing 10 durable messages on Broker-1, we find that we don&#8217;t have the same issue of duplicate messages this time.\u00a0<\/b><\/p>\n<p>As expected all the 10 messages are processed by C1, C2 and C3 as shown by screenshots below.<\/p>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-msg-processed.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26378\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-msg-processed.jpg\" alt=\"broker-1-msg-processed\" width=\"640\" height=\"104\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-msg-processed.jpg 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-msg-processed-300x49.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-1-msg-processed-1024x168.jpg 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Broker-1&#8217;s Durable Topic Subscribers<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\n<tbody>\n<tr>\n<td><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-msg-processed.jpg\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-26379\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-msg-processed.jpg\" alt=\"broker-3-msg-processed\" width=\"640\" height=\"104\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-msg-processed.jpg 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-msg-processed-300x49.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/broker-3-msg-processed-1024x167.jpg 1024w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td>Broker-3&#8217;s Durable Topic Subscribers C2 and C3 receive and process 10 messages each<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\nHence we have seen how conduitSubscriptions attribute can help in reducing message traffic by avoiding duplicate messages in a network of brokers.<\/p>\n<p>In the next part 6, we will see how ActiveMQ provides &#8220;message replay&#8221; capabilities in order to prevent stuck message scenarios.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/akuntamukkala.blogspot.com\/2014\/05\/activemq-network-of-brokers-explained.html\">ActiveMQ &#8211; Network of Brokers Explained &#8211; Part 5<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Ashwini Kuntamukkala at the <a href=\"http:\/\/akuntamukkala.blogspot.com\/\">Ashwini Kuntamukkala &#8211; Technology Enthusiast<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same configuration would work if we had concurrent remote durable subscribers on a topic. \u00a0Consider the following configuration&#8230;. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fig 1: Network &hellip;<\/p>\n","protected":false},"author":547,"featured_media":48,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[173,59],"class_list":["post-26236","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-activemq","tag-jms"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ActiveMQ - Network of Brokers Explained - Part 5<\/title>\n<meta name=\"description\" content=\"In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ActiveMQ - Network of Brokers Explained - Part 5\" \/>\n<meta property=\"og:description\" content=\"In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-06-10T19:00:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-activemq-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashwini Kuntamukkala\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/akuntamukkala\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashwini Kuntamukkala\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html\"},\"author\":{\"name\":\"Ashwini Kuntamukkala\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d48995ed879ff58e7d32f6f45df756d2\"},\"headline\":\"ActiveMQ &#8211; Network of Brokers Explained &#8211; Part 5\",\"datePublished\":\"2014-06-10T19:00:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html\"},\"wordCount\":774,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-activemq-logo.jpg\",\"keywords\":[\"Apache ActiveMQ\",\"JMS\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html\",\"name\":\"ActiveMQ - Network of Brokers Explained - Part 5\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-activemq-logo.jpg\",\"datePublished\":\"2014-06-10T19:00:54+00:00\",\"description\":\"In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-activemq-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-activemq-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/06\\\/activemq-network-of-brokers-explained-part-5.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"ActiveMQ &#8211; Network of Brokers Explained &#8211; Part 5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/d48995ed879ff58e7d32f6f45df756d2\",\"name\":\"Ashwini Kuntamukkala\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/db91d54d3feefca7c2a64d2de4b2bbaa3eba8c0b7453ec714f7d0592e1225c75?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/db91d54d3feefca7c2a64d2de4b2bbaa3eba8c0b7453ec714f7d0592e1225c75?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/db91d54d3feefca7c2a64d2de4b2bbaa3eba8c0b7453ec714f7d0592e1225c75?s=96&d=mm&r=g\",\"caption\":\"Ashwini Kuntamukkala\"},\"description\":\"Ashwini is an open source, cloud and mobile development enthusiast. He has over 10 years of experience in leading and implementing several enterprise grade solutions in pharmacy, health care and travel industries. He is currently working as a Software Architect at SciSpike, Inc where they help their clients adopt best enterprise software development\\\/governance practices through consulting, training and software development services. When not working and having fun with his family, he finds time to blog key ideas that he discovers when solving challenging problems.\",\"sameAs\":[\"http:\\\/\\\/akuntamukkala.blogspot.gr\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/pub\\\/ashwini-kuntamukkala\\\/25\\\/41b\\\/754\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/akuntamukkala\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/ashwini-kuntamukkala\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ActiveMQ - Network of Brokers Explained - Part 5","description":"In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html","og_locale":"en_US","og_type":"article","og_title":"ActiveMQ - Network of Brokers Explained - Part 5","og_description":"In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same","og_url":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-06-10T19:00:54+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-activemq-logo.jpg","type":"image\/jpeg"}],"author":"Ashwini Kuntamukkala","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/akuntamukkala","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ashwini Kuntamukkala","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html"},"author":{"name":"Ashwini Kuntamukkala","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d48995ed879ff58e7d32f6f45df756d2"},"headline":"ActiveMQ &#8211; Network of Brokers Explained &#8211; Part 5","datePublished":"2014-06-10T19:00:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html"},"wordCount":774,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-activemq-logo.jpg","keywords":["Apache ActiveMQ","JMS"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html","url":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html","name":"ActiveMQ - Network of Brokers Explained - Part 5","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-activemq-logo.jpg","datePublished":"2014-06-10T19:00:54+00:00","description":"In the previous part 4 we have seen how to load balance remote consumers on a queue using network connectors. In this part 5, we will see how the same","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-activemq-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-activemq-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/06\/activemq-network-of-brokers-explained-part-5.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"ActiveMQ &#8211; Network of Brokers Explained &#8211; Part 5"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/d48995ed879ff58e7d32f6f45df756d2","name":"Ashwini Kuntamukkala","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/db91d54d3feefca7c2a64d2de4b2bbaa3eba8c0b7453ec714f7d0592e1225c75?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/db91d54d3feefca7c2a64d2de4b2bbaa3eba8c0b7453ec714f7d0592e1225c75?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/db91d54d3feefca7c2a64d2de4b2bbaa3eba8c0b7453ec714f7d0592e1225c75?s=96&d=mm&r=g","caption":"Ashwini Kuntamukkala"},"description":"Ashwini is an open source, cloud and mobile development enthusiast. He has over 10 years of experience in leading and implementing several enterprise grade solutions in pharmacy, health care and travel industries. He is currently working as a Software Architect at SciSpike, Inc where they help their clients adopt best enterprise software development\/governance practices through consulting, training and software development services. When not working and having fun with his family, he finds time to blog key ideas that he discovers when solving challenging problems.","sameAs":["http:\/\/akuntamukkala.blogspot.gr\/","http:\/\/www.linkedin.com\/pub\/ashwini-kuntamukkala\/25\/41b\/754","https:\/\/x.com\/https:\/\/twitter.com\/akuntamukkala"],"url":"https:\/\/www.javacodegeeks.com\/author\/ashwini-kuntamukkala"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/26236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/547"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=26236"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/26236\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/48"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=26236"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=26236"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=26236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}