You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by billy <Bi...@bnsflogistics.com> on 2012/06/18 20:42:21 UTC
JMX and NetworkBridge
Is it possible to use a remote JMX tool or program to restart a full duplex
network bridge between two brokers on different machines? If so how?
--
View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: JMX and NetworkBridge
Posted by Gary Tully <ga...@gmail.com>.
So the idea is that you use the stop method on the
org.apache.activemq.broker.jmx.NetworkBridgeView, so on an individual
bridge created by the network connector. There are two mbean in the
mix. The parent org.apache.activemq.broker.jmx.NetworkConnectorView
and the nested NetworkBridgeView.
static discovery of the networkConncetor should trap the stop and
initiate a restart.
Note: you should not use failover with static: discovery, let the
static discovery deal with any reconnect issues.
see: https://issues.apache.org/jira/browse/AMQ-3542 for more detail
and https://issues.apache.org/jira/browse/AMQ-3564
On 10 July 2012 21:43, billy <Bi...@bnsflogistics.com> wrote:
> It might help if I show you a piece of my active.xml file that sets up the NetworkBridges.
> <networkConnectors>
> <networkConnector name="DwhBridge" duplex="true" uri="static:(failover:(tcp://dwh:61616))" />
> <networkConnector name="EdiBridge" duplex="true" uri="static:(failover:(tcp://edi:61616))" />
> </networkConnectors>
>
>
>
> From: billy [via ActiveMQ] [mailto:ml-node+s2283324n4653842h81@n4.nabble.com]
> Sent: Tuesday, July 10, 2012 3:13 PM
> To: Billy Buzzard
> Subject: Re: JMX and NetworkBridge
>
> Gary I'm sorry I have to ask this silly questions but when I stop the NetworkConnector via the NetworkConnectorViewMBean what auto-restarts the NetworkConnector? Perhaps I missed something in the configuration and that's my problem. Or, maybe the auto-restart does work and it's not updating the rmiregistry with the newly start Network connector. Whatever the reason, the NetworkConnector does not reappear in JConsole.
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653842.html
> To unsubscribe from JMX and NetworkBridge, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653357&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NjUzMzU3fC05MjA3NTk2MzE=>.
> 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>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653846.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
http://fusesource.com
http://blog.garytully.com
RE: JMX and NetworkBridge
Posted by billy <Bi...@bnsflogistics.com>.
It might help if I show you a piece of my active.xml file that sets up the NetworkBridges.
<networkConnectors>
<networkConnector name="DwhBridge" duplex="true" uri="static:(failover:(tcp://dwh:61616))" />
<networkConnector name="EdiBridge" duplex="true" uri="static:(failover:(tcp://edi:61616))" />
</networkConnectors>
From: billy [via ActiveMQ] [mailto:ml-node+s2283324n4653842h81@n4.nabble.com]
Sent: Tuesday, July 10, 2012 3:13 PM
To: Billy Buzzard
Subject: Re: JMX and NetworkBridge
Gary I'm sorry I have to ask this silly questions but when I stop the NetworkConnector via the NetworkConnectorViewMBean what auto-restarts the NetworkConnector? Perhaps I missed something in the configuration and that's my problem. Or, maybe the auto-restart does work and it's not updating the rmiregistry with the newly start Network connector. Whatever the reason, the NetworkConnector does not reappear in JConsole.
________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653842.html
To unsubscribe from JMX and NetworkBridge, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653357&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NjUzMzU3fC05MjA3NTk2MzE=>.
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>
--
View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653846.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: JMX and NetworkBridge
Posted by billy <Bi...@bnsflogistics.com>.
Gary I'm sorry I have to ask this silly questions but when I stop the
NetworkConnector via the NetworkConnectorViewMBean what *auto-restarts* the
NetworkConnector? Perhaps I missed something in the configuration and
that's my problem. Or, maybe the auto-restart does work and it's not
updating the rmiregistry with the newly start Network connector. Whatever
the reason, the NetworkConnector does not reappear in JConsole.
--
View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653842.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: JMX and NetworkBridge
Posted by Gary Tully <ga...@gmail.com>.
hmm, it should come back when it is auto restarted by the network
connector. But the lifecycle of that MBean will be independent of how
you access it.
The idea is that a network connector will automatically reconnect in
the event of a failure.
There may be an issue here if that is not working. I had a quick peek
and I don't see any explicit junit test for restart via a jmx so there
may be an issue here.
On 20 June 2012 15:12, billy <Bi...@bnsflogistics.com> wrote:
> We’re on version 5.5.1.
>
> When I stop the initiating NetworkConnector via the NetworkConnectorViewMBean via JConsole, the entire NetworkConnectorViewMBean disappears from the list in JConsole, so I can’t call its start method. I’m still a little new to JMX and if I were to get the NetworkConnectorViewMBean via a program that I write then the bean would be persisted long enough were I could call the start method – does that make sense?
>
>
> From: gtully [via ActiveMQ] [mailto:ml-node+s2283324n4653393h62@n4.nabble.com]
> Sent: Wednesday, June 20, 2012 9:05 AM
> To: Billy Buzzard
> Subject: Re: JMX and NetworkBridge
>
> with a partially failed duplex bridge, to get it recreated, you need
> to restart the network connector, so that the initiator again starts
> to create the duplex bridge. It is not possible to just start the
> duplex responder end as all of the info it needs from the initiator
> needs to be resent.
>
> Maybe the inactivity monitor is the answer here, it will detect the
> remote connection loss and teardown and recreate the bridge.
>
> For JMX, just use the NetworkConnectorViewMBean to do the restart.
> stop/restart on the network connector and it will recreate all of the
> bridges. Or just find the single bridge mbean and stop it. The network
> connector will auto recreate that.
>
> what version are you on?
>
> On 20 June 2012 14:45, billy <[hidden email]</user/SendEmail.jtp?type=node&node=4653393&i=0>> wrote:
>
>> Thanks for the information, but sorry to hear that the possibilities are
>> limited at this time. The actual problem I was trying to solve has to do
>> with a partially failed duplex network bridge. The non-creating side of a
>> duplex network bridge is dropping for some unknown reason while the creating
>> side is still up and running. I can easily use JMX to detect the problem,
>> but I needed a way to recreate the bridge as soon as the drop was detected.
>> I'm using a spoke-and-hub topology, one of the spokes is an old WindowsXP
>> Pro machine and all I wanted to do was restart its networkbridge when I
>> detect it going down.
>>
>> Is it possible to create a SpringBean with JMX access that could
>> recreate/start the networkbridge? If yes, where's a good place to start
>> looking in the code to figure out how networkbridges are created from the
>> ActiveMQ.xml file?
>>
>>
>>
>> --
>> View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653391.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>
>
> --
> http://fusesource.com
> http://blog.garytully.com
>
> ________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653393.html
> To unsubscribe from JMX and NetworkBridge, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653357&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NjUzMzU3fC05MjA3NTk2MzE=>.
> 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>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653394.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
http://fusesource.com
http://blog.garytully.com
RE: JMX and NetworkBridge
Posted by billy <Bi...@bnsflogistics.com>.
We’re on version 5.5.1.
When I stop the initiating NetworkConnector via the NetworkConnectorViewMBean via JConsole, the entire NetworkConnectorViewMBean disappears from the list in JConsole, so I can’t call its start method. I’m still a little new to JMX and if I were to get the NetworkConnectorViewMBean via a program that I write then the bean would be persisted long enough were I could call the start method – does that make sense?
From: gtully [via ActiveMQ] [mailto:ml-node+s2283324n4653393h62@n4.nabble.com]
Sent: Wednesday, June 20, 2012 9:05 AM
To: Billy Buzzard
Subject: Re: JMX and NetworkBridge
with a partially failed duplex bridge, to get it recreated, you need
to restart the network connector, so that the initiator again starts
to create the duplex bridge. It is not possible to just start the
duplex responder end as all of the info it needs from the initiator
needs to be resent.
Maybe the inactivity monitor is the answer here, it will detect the
remote connection loss and teardown and recreate the bridge.
For JMX, just use the NetworkConnectorViewMBean to do the restart.
stop/restart on the network connector and it will recreate all of the
bridges. Or just find the single bridge mbean and stop it. The network
connector will auto recreate that.
what version are you on?
On 20 June 2012 14:45, billy <[hidden email]</user/SendEmail.jtp?type=node&node=4653393&i=0>> wrote:
> Thanks for the information, but sorry to hear that the possibilities are
> limited at this time. The actual problem I was trying to solve has to do
> with a partially failed duplex network bridge. The non-creating side of a
> duplex network bridge is dropping for some unknown reason while the creating
> side is still up and running. I can easily use JMX to detect the problem,
> but I needed a way to recreate the bridge as soon as the drop was detected.
> I'm using a spoke-and-hub topology, one of the spokes is an old WindowsXP
> Pro machine and all I wanted to do was restart its networkbridge when I
> detect it going down.
>
> Is it possible to create a SpringBean with JMX access that could
> recreate/start the networkbridge? If yes, where's a good place to start
> looking in the code to figure out how networkbridges are created from the
> ActiveMQ.xml file?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653391.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
http://fusesource.com
http://blog.garytully.com
________________________________
If you reply to this email, your message will be added to the discussion below:
http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653393.html
To unsubscribe from JMX and NetworkBridge, click here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4653357&code=QmlsbHkuQnV6emFyZEBibnNmbG9naXN0aWNzLmNvbXw0NjUzMzU3fC05MjA3NTk2MzE=>.
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>
--
View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653394.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: JMX and NetworkBridge
Posted by Gary Tully <ga...@gmail.com>.
with a partially failed duplex bridge, to get it recreated, you need
to restart the network connector, so that the initiator again starts
to create the duplex bridge. It is not possible to just start the
duplex responder end as all of the info it needs from the initiator
needs to be resent.
Maybe the inactivity monitor is the answer here, it will detect the
remote connection loss and teardown and recreate the bridge.
For JMX, just use the NetworkConnectorViewMBean to do the restart.
stop/restart on the network connector and it will recreate all of the
bridges. Or just find the single bridge mbean and stop it. The network
connector will auto recreate that.
what version are you on?
On 20 June 2012 14:45, billy <Bi...@bnsflogistics.com> wrote:
> Thanks for the information, but sorry to hear that the possibilities are
> limited at this time. The actual problem I was trying to solve has to do
> with a partially failed duplex network bridge. The non-creating side of a
> duplex network bridge is dropping for some unknown reason while the creating
> side is still up and running. I can easily use JMX to detect the problem,
> but I needed a way to recreate the bridge as soon as the drop was detected.
> I'm using a spoke-and-hub topology, one of the spokes is an old WindowsXP
> Pro machine and all I wanted to do was restart its networkbridge when I
> detect it going down.
>
> Is it possible to create a SpringBean with JMX access that could
> recreate/start the networkbridge? If yes, where's a good place to start
> looking in the code to figure out how networkbridges are created from the
> ActiveMQ.xml file?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653391.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
http://fusesource.com
http://blog.garytully.com
Re: JMX and NetworkBridge
Posted by billy <Bi...@bnsflogistics.com>.
Thanks for the information, but sorry to hear that the possibilities are
limited at this time. The actual problem I was trying to solve has to do
with a partially failed duplex network bridge. The non-creating side of a
duplex network bridge is dropping for some unknown reason while the creating
side is still up and running. I can easily use JMX to detect the problem,
but I needed a way to recreate the bridge as soon as the drop was detected.
I'm using a spoke-and-hub topology, one of the spokes is an old WindowsXP
Pro machine and all I wanted to do was restart its networkbridge when I
detect it going down.
Is it possible to create a SpringBean with JMX access that could
recreate/start the networkbridge? If yes, where's a good place to start
looking in the code to figure out how networkbridges are created from the
ActiveMQ.xml file?
--
View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653391.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: JMX and NetworkBridge
Posted by Gary Tully <ga...@gmail.com>.
To answer your original question, the NetworkConnectorViewMBean will
allow stop/start
W.r.t to dynamically creating them via jmx, the config options are
very limited at the moment,
it is mostly that getters that are exposed via jmx
On 20 June 2012 14:11, billy <Bi...@bnsflogistics.com> wrote:
> Using JConsole, I found the org.apache.activemq.Broker object and it has the
> Operator "addNetworkConnector that takes a string representing the
> discoveryAddress. I enter "static:(tcp://dwh:61816)" for my
> discoveryAddress and a new networkConnector is created with a fixed name of
> "localhost".
>
> 1. How can I set or change the name of the new NetworkConnector via JMX?
> 2. How do I create/start the NetworkBridge from the NetworkConnector?
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653389.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
--
http://fusesource.com
http://blog.garytully.com
Re: JMX and NetworkBridge
Posted by billy <Bi...@bnsflogistics.com>.
Using JConsole, I found the org.apache.activemq.Broker object and it has the
Operator "addNetworkConnector that takes a string representing the
discoveryAddress. I enter "static:(tcp://dwh:61816)" for my
discoveryAddress and a new networkConnector is created with a fixed name of
"localhost".
1. How can I set or change the name of the new NetworkConnector via JMX?
2. How do I create/start the NetworkBridge from the NetworkConnector?
--
View this message in context: http://activemq.2283324.n4.nabble.com/JMX-and-NetworkBridge-tp4653357p4653389.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.