activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor Romero (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache ActiveMQ > Clustering
Date Mon, 08 Sep 2014 14:20:00 GMT
<html>
    <head>
        <meta name="viewport" content="width=device-width" />
        <base href="https://cwiki.apache.org/confluence" />
        <style type="text/css">
    body, #email-content, #email-content-inner { font-family: Arial,FreeSans,Helvetica,sans-serif;
}
    body, p, blockquote, pre, code, td, th, li, dt, dd { font-size: 13px; }
    small { font-size: 11px; }

    body { width:100% !important; -webkit-font-smoothing: antialiased; }

    body,
    #email-wrapper { background-color: #f0f0f0; }
    #email-wrapper-inner { padding: 20px; text-align: center; }
    #email-content-inner { background-color: #fff; border: 1px solid #bbb; color: $menuTxtColour;
padding:20px; text-align:left; }
    #email-wrapper-inner > table { width: 100%; }
    #email-wrapper-inner.thin > table { margin: 0 auto; width: 50%; }
    #email-footer { padding: 0 16px 32px 16px; margin: 0; }

    .email-indent { margin: 8px 0 16px 0; }
    .email-comment { margin: 0 0 0 56px; }
    .email-comment.removed { background-color: #ffe7e7; border: 1px solid #df9898; padding:
0 8px;}

    #email-title-avatar { text-align: left; vertical-align: top; width: 48px; padding-right:
8px; }
    #email-title-flavor { margin: 0; padding: 0 0 4px 0; }
    #email-title-heading { font-size: 16px; line-height: 20px; min-height: 20px; margin: 0;
padding: 0; }
    #email-title .icon { border: 0; padding: 0 5px 0 0; text-align: left; vertical-align:
middle; }

    #email-actions { border-top: 1px solid #bbb; color: #505050; margin: 8px 0 0 0; padding:
0; }
    #email-actions td { padding-top: 8px; }
    #email-actions .left { max-width: 45%; text-align: left; }
    #email-actions .right { text-align: right; }
    .email-reply-divider { border-top: 1px solid #bbb; color: #505050; margin: 32px 0 8px
0; padding: 8px 0; }
    .email-section-title { border-bottom: 1px solid #bbb; margin: 8px 0; padding: 8px 0 0
0; }

    .email-metadata { color: #505050; }

    a { color: #326ca6; text-decoration: none; }
    a:hover { color: #336ca6; text-decoration: underline; }
    a:active {color: #326ca6; }

    a.email-footer-link { color: #505050; font-size: 11px; }

    .email-item-list { list-style: none; margin: 4px 0; padding-left: 0; }
    .email-item-list li { list-style: none; margin: 0; padding: 4px 0; }
    .email-list-divider { color: #505050; padding: 0 0.35em; }
    .email-operation-icon { padding-right: 5px; }

    .avatar { -ms-interpolation-mode: bicubic; border-radius: 3px;}
    .avatar-link { margin: 2px; }

    .tableview th { border-bottom: 1px solid #69C; font-weight: bold; text-align: left; }
    .tableview td { border-bottom: 1px solid #bbbbbb; text-align: left; padding: 4px 16px
4px 0; }

    .aui-message {  margin: 1em 0; padding: 8px; }
    .aui-message.info { background-color: #e0f0ff; border: 1px solid #9eb6d4; }
    .aui-message.success { background-color: #ddfade; border: 1px solid #93c49f; }
    .aui-message.error,
    .aui-message.removed { background-color: #ffe7e7; border: 1px solid #df9898; color: #000;
}

    .call-to-action-table { margin: 10px 1px 1px 1px;}
    .call-to-cancel-container, .call-to-action-container { padding: 5px 20px; }
    .call-to-cancel-container { border: 1px solid #aaa; background-color: #eee; border-radius:
3px; }
    .call-to-cancel-container a.call-to-cancel-button { background-color: #eee; font-size:
14px; line-height: 1; padding: 0; margin: 0; color: #666; font-family: sans-serif;}
    .call-to-action-container { border: 1px solid #486582;  background-color: #3068A2; border-radius:
3px; padding: 4px 10px; }
    .call-to-action-container a.call-to-action-button { background-color: #3068A2; font-size:
14px; line-height: 1; padding: 0; margin: 0; color: #fff; font-weight: bold; font-family:
sans-serif; }

    /** The span around the inline task checkbox image */
    .diff-inline-task-overlay {
        display: inline-block;
        text-align: center;
        height: 1.5em;
        padding: 5px 0px 1px 5px;
        margin-right: 5px;
        /** Unfortunately, the negative margin-left is stripped out in gmail */
        margin-left: -5px;
    }

            @media handheld, only screen and (max-device-width: 480px) {
        div, a, p, td, th, li, dt, dd { -webkit-text-size-adjust: auto; }
        small, small a { -webkit-text-size-adjust: 90%; }

        td[id=email-wrapper-inner] { padding: 2px !important; }
        td[id=email-content-inner] { padding: 8px !important; }
        td[id="email-wrapper-inner"][class="thin"] > table { text-align: left !important;
width: 100% !important; }
        td[id=email-footer] { padding: 8px 12px !important; }
        div[class=email-indent] { margin: 8px 0px !important; }
        div[class=email-comment] { margin: 0 !important; }

        p[id=email-title-flavor] a { display: block; } /* puts the username and the action
on separate lines */
        p[id=email-permalink] { padding: 4px 0 0 0 !important; }

        table[id=email-actions] td { padding-top: 0 !important; }
        table[id=email-actions] td.right { text-align: right !important; }
        table[id=email-actions] .email-list-item { display: block; margin: 1em 0 !important;
word-wrap: normal !important; }
        span[class=email-list-divider] { display: none; }
    }



        </style>
    </head>
    <body style="font-family: Arial, FreeSans, Helvetica, sans-serif; font-size: 13px;
width: 100%; -webkit-font-smoothing: antialiased; background-color: #f0f0f0">
        <table id="email-wrapper" width="100%" cellspacing="0" cellpadding="0" border="0"
style="background-color: #f0f0f0">
            <tbody>
                <tr valign="middle">
                    <td id="email-wrapper-inner" style="font-size: 13px; padding: 20px;
text-align: center">
                        <table id="email-content" cellspacing="0" cellpadding="0" border="0"
style="font-family: Arial, FreeSans, Helvetica, sans-serif; width: 100%">
                            <tbody>
                                <tr valign="top">
                                    <td id="email-content-inner" align="left" style="font-family:
Arial, FreeSans, Helvetica, sans-serif; font-size: 13px; background-color: #fff; border: 1px
solid #bbb; padding: 20px; text-align: left">
                                        <table id="email-title" cellpadding="0" cellspacing="0"
border="0" width="100%">
                                            <tbody>
                                                <tr>
                                                    <td id="email-title-avatar" rowspan="2"
style="font-size: 13px; text-align: left; vertical-align: top; width: 48px; padding-right:
8px"> <img class="avatar" src="cid:avatar_eb5851986c307693e465fa2cbc688408" border="0"
height="48" width="48" style="-ms-interpolation-mode: bicubic; border-radius: 3px" /> </td>
                                                    <td valign="top" style="font-size:
13px">
                                                        <div id="email-title-flavor" class="email-metadata"
style="margin: 0; padding: 0 0 4px 0; color: #505050">
                                                            <a href="    https://cwiki.apache.org/confluence/display/~vromero
" style="color:#326ca6;text-decoration:none;; color: #326ca6; text-decoration: none">Victor
Romero</a> edited the page:
                                                        </div> </td>
                                                </tr>
                                                <tr>
                                                    <td valign="top" style="font-size:
13px"> <h2 id="email-title-heading" style="font-size: 16px; line-height: 20px; min-height:
20px; margin: 0; padding: 0"> <a href="https://cwiki.apache.org/confluence/display/ACTIVEMQ/Clustering"
style="color: #326ca6; text-decoration: none"> <img class="icon" src="cid:page-icon"
alt="" style="border: 0; padding: 0 5px 0 0; text-align: left; vertical-align: middle" />
<strong style="font-size:16px;line-height:20px;vertical-align:top;">Clustering</strong>
</a> </h2> </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                        <div class="email-indent" style="margin: 8px 0
16px 0">
                                            <div class="email-diff">
                                                <div id="page-diffs" class="wiki-content">
                                                    <p class="diff-block-target" style="font-size:
13px">Clustering is a large <span class="diff-html-removed" id="removed-diff-0" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">area </span><span
class="diff-html-added" id="added-diff-0" style="font-size: 100%; background-color: #ddfade;">topic
</span>and often means different things to different people. We'll try to list the various
aspects of clustering and how they relate to ActiveMQ</p>
                                                    <p class="diff-context-placeholder"
style="font-size: 13px">...</p>
                                                    <p class="diff-block-context" style="font-size:
13px">ActiveMQ supports reliable high performance load balancing of messages on a queue
across consumers. In enterprise integration, this scenario is known as the&nbsp;<a
href="http://www.eaipatterns.com/CompetingConsumers.html" class="external-link" rel="nofollow"
style="color: #326ca6; text-decoration: none">competing consumers</a> pattern. The
following figure illustrates the concept:</p>
                                                    <p class="diff-block-context" style="font-size:
13px"> <img class="confluence-embedded-image image-center" src="/confluence/download/attachments/35981/competing-consumers.png?version=1&amp;modificationDate=1410121265000&amp;api=v2"
data-image-src="/confluence/download/attachments/35981/competing-consumers.png?version=1&amp;modificationDate=1410121265000&amp;api=v2"
/></p>
                                                    <p class="diff-block-target diff-block-context"
style="font-size: 13px"> <span style="line-height: 1.4285715;">This solution <span
class="diff-html-removed" id="removed-diff-1" style="font-size: 100%; background-color: #ffe7e7;
text-decoration: line-through;">will receive </span><span class="diff-html-added"
id="added-diff-1" style="font-size: 100%; background-color: #ddfade;">receives </span>the
messages sent by the producers, <span class="diff-html-removed" id="removed-diff-2" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">enqueue </span><span
class="diff-html-added" id="added-diff-2" style="font-size: 100%; background-color: #ddfade;">enqueues
</span>them and <span class="diff-html-removed" id="removed-diff-3" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">distribute </span><span
class="diff-html-added" id="added-diff-3" style="font-size: 100%; background-color: #ddfade;">distributes
</span>them between all the registered consumers. This has a number of benefits:</span>
</p>
                                                    <ul class="diff-block-target">
                                                        <li style="font-size: 13px">
<span style="line-height: 1.4285715;">The load is <span class="diff-html-removed"
id="removed-diff-4" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">distrubuted
</span><span class="diff-html-added" id="added-diff-4" style="font-size: 100%; background-color:
#ddfade;">distributed </span>in a very dynamic fashion. <span class="diff-html-removed"
id="removed-diff-5" style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">Consumers
</span><span class="diff-html-added" id="added-diff-5" style="font-size: 100%; background-color:
#ddfade;">Additional consumers </span>could be provisioned and attached to the queue
in high load periods, without modifying any configuration in the queue, as the new <span
class="diff-html-removed" id="removed-diff-6" style="font-size: 100%; background-color: #ffe7e7;
text-decoration: line-through;">consumier will </span><span class="diff-html-added"
id="added-diff-6" style="font-size: 100%; background-color: #ddfade;">consumer would </span>behave
as just another competing consumer.</span> </li>
                                                        <li style="font-size: 13px">
<span style="line-height: 1.4285715;">Better availability than systems using a load
balancer. Load balancers usually rely on a monitorization system to find out which real-servers
are unavailable. With competing consumers<span class="diff-html-added" id="added-diff-7"
style="font-size: 100%; background-color: #ddfade;">, </span>a failed consumer won't
be competing for messages and <span class="diff-html-removed" id="removed-diff-7" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">therefor </span><span
class="diff-html-added" id="added-diff-8" style="font-size: 100%; background-color: #ddfade;">therefore
</span>messages won't be delivered to it even without monitorization.</span> </li>
                                                        <li style="font-size: 13px">High
reliability, if a consumer dies, any unacknowledged messages are redelivered to other consumers
on the queue.</li>
                                                    </ul>
                                                    <p class="diff-block-target" style="font-size:
13px">On the downside, this pattern might not be ideal in systems where the ordered processing
is required. To mitigate this problem while maintaining the benefits, the competing consumers
pattern should be used in <span class="diff-html-removed" id="removed-diff-8" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">conjuntion </span><span
class="diff-html-added" id="added-diff-9" style="font-size: 100%; background-color: #ddfade;">conjunction
</span>with other ActiveMQ&nbsp;<a class="confluence-link unresolved" href="#"
style="color: #326ca6; text-decoration: none">features</a>&nbsp;like the <a
class="confluence-link unresolved" href="#" style="color: #326ca6; text-decoration: none">exclusive
consumers</a> and the <a class="confluence-link unresolved" href="#" style="color:
#326ca6; text-decoration: none">message groups</a>&nbsp;as stated in the <a
class="confluence-link unresolved" href="#" style="color: #326ca6; text-decoration: none">ActiveMQ's
FAQ</a>.</p>
                                                    <p class="diff-context-placeholder"
style="font-size: 13px">...</p>
                                                    <p class="diff-block-target" style="font-size:
13px">If we just run multiple brokers on a network and tell the clients about them using
either <a href="http://incubator.apache.org/activemq/static-transport-reference.html" class="external-link"
rel="nofollow" style="color: #326ca6; text-decoration: none">static discovery</a>
or <a href="http://incubator.apache.org/activemq/discovery-transport-reference.html" class="external-link"
rel="nofollow" style="color: #326ca6; text-decoration: none">dynamic discovery</a><span
class="diff-html-added" id="added-diff-10" style="font-size: 100%; background-color: #ddfade;">,
</span>then clients can easily failover from one broker to another. However<span
class="diff-html-added" id="added-diff-11" style="font-size: 100%; background-color: #ddfade;">,
</span>stand alone brokers don't know about consumers on other brokers; so if there
are no consumers on a certain broker<span class="diff-html-added" id="added-diff-12" style="font-size:
100%; background-color: #ddfade;">, </span>messages could just pile up without being
consumed. We have an outstanding <a href="http://issues.apache.org/activemq/browse/AMQ-816"
class="external-link" rel="nofollow" style="color: #326ca6; text-decoration: none">feature
request</a> to tackle this on the client side - but currently the solution to this problem
is to create a Network of brokers to store and forward messages between brokers.</p>
                                                    <p class="diff-context-placeholder"
style="font-size: 13px">...</p>
                                                    <p class="diff-block-target" style="font-size:
13px">We support <a class="confluence-link unresolved" href="#" style="color: #326ca6;
text-decoration: none">auto-discovery</a> of brokers using <a href="http://incubator.apache.org/activemq/static-transport-reference.html"
class="external-link" rel="nofollow" style="color: #326ca6; text-decoration: none">static
discovery</a> or <a href="http://incubator.apache.org/activemq/discovery-transport-reference.html"
class="external-link" rel="nofollow" style="color: #326ca6; text-decoration: none">dynamic
discovery</a><span class="diff-html-removed" id="removed-diff-9" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">so </span><span
class="diff-html-added" id="added-diff-13" style="font-size: 100%; background-color: #ddfade;">,&nbsp;so
</span>clients can automatically detect and connect to a broker out of a logical group
of brokers as well for brokers to discover and connect to other brokers to form large networks.</p>
                                                    <p class="diff-context-placeholder"
style="font-size: 13px">...</p>
                                                    <p class="diff-block-target" style="font-size:
13px">If you are using <a class="confluence-link unresolved" href="#" style="color:
#326ca6; text-decoration: none">client/server or hub/spoke style topology</a> and
you have many clients and many brokers<span class="diff-html-removed" id="removed-diff-10"
style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;">; </span><span
class="diff-html-added" id="added-diff-14" style="font-size: 100%; background-color: #ddfade;">,
</span>there is a chance that one broker has producers but no consumers<span class="diff-html-added"
id="added-diff-15" style="font-size: 100%; background-color: #ddfade;">, </span>so
that messages pile up without being processed. To avoid this<span class="diff-html-added"
id="added-diff-16" style="font-size: 100%; background-color: #ddfade;">, </span>ActiveMQ
supports a <a class="confluence-link unresolved" href="#" style="color: #326ca6; text-decoration:
none">Networks of Brokers</a> which provides <em>store and forward</em>
to move messages from brokers with producers to brokers with consumers which allows us to
support <a class="confluence-link unresolved" href="#" style="color: #326ca6; text-decoration:
none">distributed queues and topics</a> across a network of brokers.</p>
                                                    <p class="diff-block-target" style="font-size:
13px">This allows a client to connect to any broker - and fail over to another broker if
there is a failure - providing <span class="diff-html-removed" id="removed-diff-11" style="font-size:
100%; background-color: #ffe7e7; text-decoration: line-through;">from </span><span
class="diff-html-added" id="added-diff-17" style="font-size: 100%; background-color: #ddfade;">a
cluster of brokers&nbsp;from </span>the clients perspective<span class="diff-html-removed"
style="font-size: 100%; background-color: #ffe7e7; text-decoration: line-through;"> </span><span
class="diff-html-removed" id="removed-diff-12" style="font-size: 100%; background-color: #ffe7e7;
text-decoration: line-through;">a cluster of brokers</span>.</p>
                                                    <p class="diff-block-target diff-block-context"
style="font-size: 13px">Networks of brokers also allows us to scale up to <span class="diff-html-added"
id="added-diff-18" style="font-size: 100%; background-color: #ddfade;">a </span>massive
number of clients in a network as we can run as many brokers as we need.</p>
                                                    <p class="diff-block-target" style="font-size:
13px">You can think of this as a cluster of clients connecting with a cluster of brokers
with auto-failover and discovery<span class="diff-html-added" id="added-diff-19" style="font-size:
100%; background-color: #ddfade;">, </span>making a simple and easy to use messaging
fabric.</p>
                                                    <p class="diff-context-placeholder"
style="font-size: 13px">...</p>
                                                    <p class="diff-block-target" style="font-size:
13px">The idea behind <a class="confluence-link unresolved" href="#" style="color: #326ca6;
text-decoration: none">MasterSlave</a> is that messages are replicated to a slave
broker so that even if you have <span class="diff-html-added" id="added-diff-20" style="font-size:
100%; background-color: #ddfade;">a </span>catastrophic hardware failure of the master's
machine, file system or data centre, you get immediate failover to the slave with no message
loss.</p>
                                                    <p class="diff-context-placeholder"
style="font-size: 13px">...</p>
                                                    <p class="diff-block-target" style="font-size:
13px">So by supporting a <a class="confluence-link unresolved" href="#" style="color:
#326ca6; text-decoration: none">Replicated Message Store</a> you can reduce the risk
of message loss to provide either a HA backup or a full <a class="confluence-link unresolved"
href="#" style="color: #326ca6; text-decoration: none">DR</a> solution capable of
surviving <span class="diff-html-added" id="added-diff-21" style="font-size: 100%; background-color:
#ddfade;">a </span>data centre failure.</p>
                                                </div>
                                            </div>
                                        </div>
                                        <table id="email-actions" class="email-metadata"
cellspacing="0" cellpadding="0" border="0" width="100%" style="border-top: 1px solid #bbb;
color: #505050; margin: 8px 0 0 0; padding: 0; color: #505050">
                                            <tbody>
                                                <tr>
                                                    <td class="left" valign="top" style="font-size:
13px; padding-top: 8px; max-width: 45%; text-align: left"> <span class="email-list-item"><a
href="https://cwiki.apache.org/confluence/display/ACTIVEMQ/Clustering" style="color: #326ca6;
text-decoration: none">View Online</a> </span> <span class="email-list-divider"
style="color: #505050; padding: 0 0.350em">&middot;</span> <span class="email-list-item"><a
href="https://cwiki.apache.org/confluence/plugins/likes/like.action?contentId=35981" style="color:
#326ca6; text-decoration: none">Like</a> </span> <span class="email-list-divider"
style="color: #505050; padding: 0 0.350em">&middot;</span> <span class="email-list-item"><a
href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=35981&amp;revisedVersion=25&amp;originalVersion=24"
style="color: #326ca6; text-decoration: none">View Changes</a> </span> </td>
                                                    <td class="right" width="50%" valign="top"
style="font-size: 13px; padding-top: 8px; text-align: right"> <span class="email-list-item"><a
href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=ACTIVEMQ"
style="color: #326ca6; text-decoration: none">Stop watching space</a> </span>
<span class="email-list-divider" style="color: #505050; padding: 0 0.350em">&middot;</span>
<span class="email-list-item"><a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action"
style="color: #326ca6; text-decoration: none">Manage Notifications</a> </span>
</td>
                                                </tr>
                                            </tbody>
                                        </table> </td>
                                </tr>
                            </tbody>
                        </table> </td>
                </tr>
                <tr>
                    <td id="email-footer" align="center" style="font-size: 13px; padding:
0 16px 32px 16px; margin: 0"> <small style="font-size: 11px"> This message was sent
by <a class="email-footer-link" style="color:#505050;font-size:11px;text-decoration:none;;
color: #326ca6; text-decoration: none; color: #505050; font-size: 11px" href="http://www.atlassian.com/software/confluence">Atlassian
Confluence</a> 5.0.3, <a class="email-footer-link" style="color:#505050;font-size:11px;text-decoration:none;;
color: #326ca6; text-decoration: none; color: #505050; font-size: 11px" href="http://www.atlassian.com/software/confluence/overview/team-collaboration-software?utm_source=email-footer">Team
Collaboration Software</a> </small> </td>
                </tr>
            </tbody>
        </table>
    </body>
</html>
Mime
View raw message