You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by tybreizh29 <ml...@vecsys.fr> on 2016/01/06 12:22:30 UTC

failover and cannot access queue

Hi,
I've got 4 machines running ActiveMQ, the config is  (names, ports changed):

<networkConnectors>
        <networkConnector name="SYSTEM1" duplex="true"
uri="static:(tcp://cluster1.aaa.com:222)" userName="system" password="">
                <dynamicallyIncludedDestinations>
                        <topic physicalName="outgoing.System1" />
                </dynamicallyIncludedDestinations>
        </networkConnector>
        <networkConnector name="SYSTEM2" duplex="true"
uri="static:(tcp://amidala.aaa.com:222)" userName="system" password="">
                <dynamicallyIncludedDestinations>
                        <topic physicalName="outgoing.System2"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
        <networkConnector name="SYSTEM3" duplex="true"
uri="static:(tcp://msf01.aaa.com:222)" userName="system" password="">
                <dynamicallyIncludedDestinations>
                        <topic physicalName="outgoing.System3"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
        <networkConnector name="SYSTEM4" duplex="true"
uri="static:(tcp://msf02.aaa.com:222)" userName="system" password="">
                <dynamicallyIncludedDestinations>
                        <topic physicalName="outgoing.System4"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
     </networkConnectors>


I write messages into a cluster1 queue using PHP and STOMP, I see the
message in cluster1 web console (jetty one).
I don't see the message on others web gui. They say cluster1 is the active
machine.

I want to read the message with java, the uri is:
'failover:(tcp://msf01.aaa.com:222,tcp://msf02.aaa.com:222,tcp://cluster1.aaa.com:222,tcp://amidala.aaa.com:222)?timeout=10000&jms.prefetchPolicy.queuePrefetch=1';

there is no message to read with this settings, 
if i put cluster1 as the first machine in the failover machine order, it
works, but like that I'm not sure the failover works.

what's wrong with my setting.
thanks for your help.
marc







--
View this message in context: http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: failover and cannot access queue

Posted by tybreizh29 <ml...@vecsys.fr>.
I've checked the logs, I see no self connection.
I've changed TTL to 4, but i'm at home, i'll test tomorrow.
you're right, i'm not sure msf01 and ms02 are used to dequeue messages, i have to check the logs next time.
i thought they were used because they are very close to the messages readers (local network), others are on the Internet.
thanks.
marc

Le 28/01/2016 15:17, Tim Bain [via ActiveMQ] a écrit :
No, I meant that I think the amidala broker shouldn't have a
networkConnector to amidala, and same for the other three.

You can't consume messages that have been forwarded to a second broker from
clients on a third broker because the default networkTTL for
networkConnectors is only 1.  Increase it to allow additional forwards.
See also the Stuck Messages section of
http://activemq.apache.org/networks-of-brokers.html.  In fact, read the
whole thing, if you haven't already.

When you say you don't see any messages on msf01 or msf02, did you have
consumers there when the messages were published?  If not, why do you
expect to see messages there?

Tim
On Jan 28, 2016 7:20 AM, "tybreizh29" <[hidden email]</user/SendEmail.jtp?type=node&node=4706590&i=0>> wrote:

> Hi Tim
> yes i'm having the same config (except the broker name change).
> when you say not not send to itself you mean for example system write :
>                <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System2" />
>                         <topic physicalName="outgoing.System3" />
>                         <topic physicalName="outgoing.System4" />
>                 </dynamicallyIncludedDestinations>
>
> Regarding what happened:
> I've posted some message to cluster1, i saw some of those messages on
> amidala, some have been dequeued from cluster1. i did not see any message
> arriving on msf01 or msf02.
> I'm unable to dequeue the messages on amidala from any other server, they
> remain there.
> marc
>
>
> Le 28/01/2016 06:28, Tim Bain [via ActiveMQ] a écrit :
> Are you using this config file for all four brokers?  It looks like you're
> having each broker connect not only to the other three but also to itself;
> is that true?  If so, I'm not sure what happens if a broker connects to
> itself, but I'd try eliminating that from the configuration and see if it
> changes anything.
>
> Also, are you getting zero messages forwarded, or some but not all?  And is
> the problem that some messages can't be consumed because there is no
> consumer on the broker on which they're published, or just that that local
> consumers are taking all the messages so consumers on the other brokers
> never get any?  If you could describe what you expect to happen and what's
> actually happening in more detail (including information like which
> producers and consumers are on which brokers), that may make it faster and
> easier to help you figure out what's going on.
>
> Tim
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706563.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706590.html
To unsubscribe from failover and cannot access queue, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4705622&code=bWxlbWV1ckB2ZWNzeXMuZnJ8NDcwNTYyMnwtMTk0MjAyMDE2MA==>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--
[cid:part7.00070908.09060308@vecsys.fr]


Signature_MLM_20120724-V2.PNG (17K) <http://activemq.2283324.n4.nabble.com/attachment/4706605/0/Signature_MLM_20120724-V2.PNG>




--
View this message in context: http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706605.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: failover and cannot access queue

Posted by tybreizh29 <ml...@vecsys.fr>.
Hi Tim
I seems to work better but now I've got message reading issues with my Java app.
I'll fix my readers before testing further the AMQ.
thanks
marc

Le 28/01/2016 15:17, Tim Bain [via ActiveMQ] a écrit :
No, I meant that I think the amidala broker shouldn't have a
networkConnector to amidala, and same for the other three.

You can't consume messages that have been forwarded to a second broker from
clients on a third broker because the default networkTTL for
networkConnectors is only 1.  Increase it to allow additional forwards.
See also the Stuck Messages section of
http://activemq.apache.org/networks-of-brokers.html.  In fact, read the
whole thing, if you haven't already.

When you say you don't see any messages on msf01 or msf02, did you have
consumers there when the messages were published?  If not, why do you
expect to see messages there?

Tim
On Jan 28, 2016 7:20 AM, "tybreizh29" <[hidden email]</user/SendEmail.jtp?type=node&node=4706590&i=0>> wrote:

> Hi Tim
> yes i'm having the same config (except the broker name change).
> when you say not not send to itself you mean for example system write :
>                <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System2" />
>                         <topic physicalName="outgoing.System3" />
>                         <topic physicalName="outgoing.System4" />
>                 </dynamicallyIncludedDestinations>
>
> Regarding what happened:
> I've posted some message to cluster1, i saw some of those messages on
> amidala, some have been dequeued from cluster1. i did not see any message
> arriving on msf01 or msf02.
> I'm unable to dequeue the messages on amidala from any other server, they
> remain there.
> marc
>
>
> Le 28/01/2016 06:28, Tim Bain [via ActiveMQ] a écrit :
> Are you using this config file for all four brokers?  It looks like you're
> having each broker connect not only to the other three but also to itself;
> is that true?  If so, I'm not sure what happens if a broker connects to
> itself, but I'd try eliminating that from the configuration and see if it
> changes anything.
>
> Also, are you getting zero messages forwarded, or some but not all?  And is
> the problem that some messages can't be consumed because there is no
> consumer on the broker on which they're published, or just that that local
> consumers are taking all the messages so consumers on the other brokers
> never get any?  If you could describe what you expect to happen and what's
> actually happening in more detail (including information like which
> producers and consumers are on which brokers), that may make it faster and
> easier to help you figure out what's going on.
>
> Tim
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706563.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.


________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706590.html
To unsubscribe from failover and cannot access queue, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4705622&code=bWxlbWV1ckB2ZWNzeXMuZnJ8NDcwNTYyMnwtMTk0MjAyMDE2MA==>.
NAML<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

--
[cid:part7.05040006.09090107@vecsys.fr]


Signature_MLM_20120724-V2.PNG (17K) <http://activemq.2283324.n4.nabble.com/attachment/4706632/0/Signature_MLM_20120724-V2.PNG>




--
View this message in context: http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706632.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: failover and cannot access queue

Posted by Tim Bain <tb...@alumni.duke.edu>.
No, I meant that I think the amidala broker shouldn't have a
networkConnector to amidala, and same for the other three.

You can't consume messages that have been forwarded to a second broker from
clients on a third broker because the default networkTTL for
networkConnectors is only 1.  Increase it to allow additional forwards.
See also the Stuck Messages section of
http://activemq.apache.org/networks-of-brokers.html.  In fact, read the
whole thing, if you haven't already.

When you say you don't see any messages on msf01 or msf02, did you have
consumers there when the messages were published?  If not, why do you
expect to see messages there?

Tim
On Jan 28, 2016 7:20 AM, "tybreizh29" <ml...@vecsys.fr> wrote:

> Hi Tim
> yes i'm having the same config (except the broker name change).
> when you say not not send to itself you mean for example system write :
>                <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System2" />
>                         <topic physicalName="outgoing.System3" />
>                         <topic physicalName="outgoing.System4" />
>                 </dynamicallyIncludedDestinations>
>
> Regarding what happened:
> I've posted some message to cluster1, i saw some of those messages on
> amidala, some have been dequeued from cluster1. i did not see any message
> arriving on msf01 or msf02.
> I'm unable to dequeue the messages on amidala from any other server, they
> remain there.
> marc
>
>
> Le 28/01/2016 06:28, Tim Bain [via ActiveMQ] a écrit :
> Are you using this config file for all four brokers?  It looks like you're
> having each broker connect not only to the other three but also to itself;
> is that true?  If so, I'm not sure what happens if a broker connects to
> itself, but I'd try eliminating that from the configuration and see if it
> changes anything.
>
> Also, are you getting zero messages forwarded, or some but not all?  And is
> the problem that some messages can't be consumed because there is no
> consumer on the broker on which they're published, or just that that local
> consumers are taking all the messages so consumers on the other brokers
> never get any?  If you could describe what you expect to happen and what's
> actually happening in more detail (including information like which
> producers and consumers are on which brokers), that may make it faster and
> easier to help you figure out what's going on.
>
> Tim
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706563.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: failover and cannot access queue

Posted by tybreizh29 <ml...@vecsys.fr>.
Hi Tim
yes i'm having the same config (except the broker name change).
when you say not not send to itself you mean for example system write :
               <dynamicallyIncludedDestinations>
                        <topic physicalName="outgoing.System2" />
                        <topic physicalName="outgoing.System3" />
                        <topic physicalName="outgoing.System4" />
                </dynamicallyIncludedDestinations>

Regarding what happened:
I've posted some message to cluster1, i saw some of those messages on amidala, some have been dequeued from cluster1. i did not see any message arriving on msf01 or msf02.
I'm unable to dequeue the messages on amidala from any other server, they remain there.
marc


Le 28/01/2016 06:28, Tim Bain [via ActiveMQ] a écrit :
Are you using this config file for all four brokers?  It looks like you're
having each broker connect not only to the other three but also to itself;
is that true?  If so, I'm not sure what happens if a broker connects to
itself, but I'd try eliminating that from the configuration and see if it
changes anything.

Also, are you getting zero messages forwarded, or some but not all?  And is
the problem that some messages can't be consumed because there is no
consumer on the broker on which they're published, or just that that local
consumers are taking all the messages so consumers on the other brokers
never get any?  If you could describe what you expect to happen and what's
actually happening in more detail (including information like which
producers and consumers are on which brokers), that may make it faster and
easier to help you figure out what's going on.

Tim




--
View this message in context: http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706563.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: failover and cannot access queue

Posted by Tim Bain <tb...@alumni.duke.edu>.
Are you using this config file for all four brokers?  It looks like you're
having each broker connect not only to the other three but also to itself;
is that true?  If so, I'm not sure what happens if a broker connects to
itself, but I'd try eliminating that from the configuration and see if it
changes anything.

Also, are you getting zero messages forwarded, or some but not all?  And is
the problem that some messages can't be consumed because there is no
consumer on the broker on which they're published, or just that that local
consumers are taking all the messages so consumers on the other brokers
never get any?  If you could describe what you expect to happen and what's
actually happening in more detail (including information like which
producers and consumers are on which brokers), that may make it faster and
easier to help you figure out what's going on.

Tim
On Jan 27, 2016 4:13 PM, "tybreizh29" <ml...@vecsys.fr> wrote:

> Hi Tim,
> Thanks a lot for your response.
> I was on another project, that's why I was sooo long to answer.
> I now understand well that the message is passed from one server to
> another.
> I have difficulties to put all pieces together.
> Unfortunately for me all leads to ActiveMQ FAQ, and i keep confused.
>
> Right now I'm publishing to cluster1 with stomp (later I will on any
> machine)
> with java i'm using the failover
> (failover:(tcp://msf01.site.com:62616,tcp://msf02.site.com:62616,tcp://
> cluster1.site.com:62616,tcp://amidala.site.com:62616)?timeout=10000'),
> so some consumers are reading messages, some are not, because no message is
> forwarded)
>
> I thought the below config should make all messages be forwarded to all
> destinations, but not really :(
> I'm still stuck :/
>
>
>    <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="amidala.site.com" dataDirectory="${activemq.data}">
>      <networkConnectors>
>         <networkConnector name="SYSTEM1" duplex="true"
> uri="static:(tcp://cluster1.site.com:62616)" userName="system"
> password="pass" decreaseNetworkConsumerPriority="true"  >
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName=">" />
>                         <queue physicalName=">"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>         <networkConnector name="SYSTEM2" duplex="true"
> uri="static:(tcp://amidala.site.com:62616)" userName="system"
> password="pass" >
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName=">"/>
>                         <queue physicalName=">"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>         <networkConnector name="SYSTEM3" duplex="true"
> uri="static:(tcp://msf01.site.com:62616)" userName="system"
> password="pass"
> >
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName=">"/>
>                         <queue physicalName=">"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>         <networkConnector name="SYSTEM4" duplex="true"
> uri="static:(tcp://msf02.site.com:62616)" userName="system"
> password="pass"
> >
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName=">"/>
>                         <queue physicalName=">"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>      </networkConnectors>
>      <transportConnectors>
>         <transportConnector uri="tcp://cluster1.site.com:62619"/>
>         <transportConnector uri="tcp://amidala.site.com:62619"/>
>         <transportConnector uri="tcp://msf01.site.com:62619"/>
>         <transportConnector uri="tcp://msf02.site.com:62619"/>
>      </transportConnectors>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706506.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: failover and cannot access queue

Posted by tybreizh29 <ml...@vecsys.fr>.
Hi Tim,
Thanks a lot for your response.
I was on another project, that's why I was sooo long to answer.
I now understand well that the message is passed from one server to another. 
I have difficulties to put all pieces together.
Unfortunately for me all leads to ActiveMQ FAQ, and i keep confused.

Right now I'm publishing to cluster1 with stomp (later I will on any
machine)
with java i'm using the failover
(failover:(tcp://msf01.site.com:62616,tcp://msf02.site.com:62616,tcp://cluster1.site.com:62616,tcp://amidala.site.com:62616)?timeout=10000'),
so some consumers are reading messages, some are not, because no message is
forwarded)

I thought the below config should make all messages be forwarded to all
destinations, but not really :(
I'm still stuck :/


   <broker xmlns="http://activemq.apache.org/schema/core"
brokerName="amidala.site.com" dataDirectory="${activemq.data}">
     <networkConnectors>
        <networkConnector name="SYSTEM1" duplex="true"
uri="static:(tcp://cluster1.site.com:62616)" userName="system"
password="pass" decreaseNetworkConsumerPriority="true"  >
                <dynamicallyIncludedDestinations>
                        <topic physicalName=">" />
                        <queue physicalName=">"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
        <networkConnector name="SYSTEM2" duplex="true"
uri="static:(tcp://amidala.site.com:62616)" userName="system"
password="pass" >
                <dynamicallyIncludedDestinations>
                        <topic physicalName=">"/>
                        <queue physicalName=">"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
        <networkConnector name="SYSTEM3" duplex="true"
uri="static:(tcp://msf01.site.com:62616)" userName="system" password="pass"
>
                <dynamicallyIncludedDestinations>
                        <topic physicalName=">"/>
                        <queue physicalName=">"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
        <networkConnector name="SYSTEM4" duplex="true"
uri="static:(tcp://msf02.site.com:62616)" userName="system" password="pass"
>
                <dynamicallyIncludedDestinations>
                        <topic physicalName=">"/>
                        <queue physicalName=">"/>
                </dynamicallyIncludedDestinations>
        </networkConnector>
     </networkConnectors>
     <transportConnectors>
        <transportConnector uri="tcp://cluster1.site.com:62619"/>
        <transportConnector uri="tcp://amidala.site.com:62619"/>
        <transportConnector uri="tcp://msf01.site.com:62619"/>
        <transportConnector uri="tcp://msf02.site.com:62619"/>
     </transportConnectors>




--
View this message in context: http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622p4706506.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: failover and cannot access queue

Posted by Tim Bain <tb...@alumni.duke.edu>.
Why are you only forwarding one destination per networkConnector, and a
different one in each case?  And what destination are you publishing to?

It sounds like you believe that you have a master/slave cluster (you say
"cluster1 is the active machine"), but that's not true.  What you actually
have is a mesh network of brokers, where each broker is a standalone entity
that can forward messages to the others (and a message exists on only one
broker at a time) and where all brokers are active at all times.  If any of
that is a surprise to you, you need to read up on those subjects on the
wiki.

You've limited which destinations will have messages forward to which other
brokers (for reasons I don't understand, but hopefully you'll explain),
which seems incompatible with your failover URI (which means that a client
will connect to only one of the brokers and that they're all equivalent,
which isn't true because some destinations can only be forwarded to certain
brokers but not others.  I suspect that your problem will disappear by
forwarding all destinations (using the wildcard ">") to all other brokers,
but I'm not sure what you were trying to accomplish with it in the first
place.  Also, I think you'll want to set the
decreaseNetworkConsumerPriority="true" option; see
http://activemq.apache.org/networks-of-brokers.html for more details.

Tim
On Jan 6, 2016 3:33 PM, "tybreizh29" <ml...@vecsys.fr> wrote:

> Hi,
> I've got 4 machines running ActiveMQ, the config is  (names, ports
> changed):
>
> <networkConnectors>
>         <networkConnector name="SYSTEM1" duplex="true"
> uri="static:(tcp://cluster1.aaa.com:222)" userName="system" password="">
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System1" />
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>         <networkConnector name="SYSTEM2" duplex="true"
> uri="static:(tcp://amidala.aaa.com:222)" userName="system" password="">
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System2"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>         <networkConnector name="SYSTEM3" duplex="true"
> uri="static:(tcp://msf01.aaa.com:222)" userName="system" password="">
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System3"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>         <networkConnector name="SYSTEM4" duplex="true"
> uri="static:(tcp://msf02.aaa.com:222)" userName="system" password="">
>                 <dynamicallyIncludedDestinations>
>                         <topic physicalName="outgoing.System4"/>
>                 </dynamicallyIncludedDestinations>
>         </networkConnector>
>      </networkConnectors>
>
>
> I write messages into a cluster1 queue using PHP and STOMP, I see the
> message in cluster1 web console (jetty one).
> I don't see the message on others web gui. They say cluster1 is the active
> machine.
>
> I want to read the message with java, the uri is:
> 'failover:(tcp://msf01.aaa.com:222,tcp://msf02.aaa.com:222,tcp://
> cluster1.aaa.com:222,tcp://amidala.aaa.com:222
> )?timeout=10000&jms.prefetchPolicy.queuePrefetch=1';
>
> there is no message to read with this settings,
> if i put cluster1 as the first machine in the failover machine order, it
> works, but like that I'm not sure the failover works.
>
> what's wrong with my setting.
> thanks for your help.
> marc
>
>
>
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/failover-and-cannot-access-queue-tp4705622.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>