You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Pablo Lozano (JIRA)" <ji...@apache.org> on 2015/11/20 03:51:10 UTC
[jira] [Comment Edited] (AMQ-6052) Network of brokers on duplex
mode reports InstanceAlreadyExistsException on already existing
destinations
[ https://issues.apache.org/jira/browse/AMQ-6052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15015059#comment-15015059 ]
Pablo Lozano edited comment on AMQ-6052 at 11/20/15 2:51 AM:
-------------------------------------------------------------
I have found the issue that activates this problem.
{code:title=MBeanBridgeDestination.java|borderStyle=solid}
private Map<ActiveMQDestination, ObjectName> destinationObjectNameMap = new ConcurrentHashMap<ActiveMQDestination, ObjectName>();
private Map<ActiveMQDestination, NetworkDestinationView> outboundDestinationViewMap = new ConcurrentHashMap<ActiveMQDestination, NetworkDestinationView>();
private Map<ActiveMQDestination, NetworkDestinationView> inboundDestinationViewMap = new ConcurrentHashMap<ActiveMQDestination, NetworkDestinationView>();
{code}
Both onOutboundMessage() and onInboundMessage() use the destinationObjectNameMap to register the ObjectName of the NetworkDestinationView. But each other overwrite their value when using a duplex connection.
{code:title=MBeanBridgeDestination.java|borderStyle=solid}
public void onInboundMessage(Message message) {
....
destinationObjectNameMap.put(destination, objectName);
}
{code}
When running with the option to purge unactiveDestinationViews which by default is active it will un-register from the MBeanServer the objectName that is found on destinationObjectNameMap.remove(entry.getKey()); //ActiveMqDestination. This happens on the method purgeInactiveDestinationView(Map<ActiveMQDestination, NetworkDestinationView> map) which receives both outboundDestinationViewMap and inboundDestinationViewMap.
Thus when running for outboundDestinationViewMap if the last registration of a destination was actually of a inBound it will incorrectly delete the object name of and inboundDestination insead of the one from outboundDestination.
I am working on a fix and submitting a patch for this issue.
This seems to be related to AMQ-5265 which looks like it tried to fix the same issue although apparently it was still present.
was (Author: altaflux):
I have found the issue that activates this problem.
{code:title=MBeanBridgeDestination.java|borderStyle=solid}
private Map<ActiveMQDestination, ObjectName> destinationObjectNameMap = new ConcurrentHashMap<ActiveMQDestination, ObjectName>();
private Map<ActiveMQDestination, NetworkDestinationView> outboundDestinationViewMap = new ConcurrentHashMap<ActiveMQDestination, NetworkDestinationView>();
private Map<ActiveMQDestination, NetworkDestinationView> inboundDestinationViewMap = new ConcurrentHashMap<ActiveMQDestination, NetworkDestinationView>();
{code}
Both onOutboundMessage() and onInboundMessage() use the destinationObjectNameMap to register the ObjectName of the NetworkDestinationView. But each other overwrite their value when using a duplex connection.
{code:title=MBeanBridgeDestination.java|borderStyle=solid}
public void onInboundMessage(Message message) {
....
destinationObjectNameMap.put(destination, objectName);
}
{code}
When running with the option to purge unactiveDestinationViews which by default is active it will un-register from the MBeanServer the objectName that is found on destinationObjectNameMap.remove(entry.getKey()); //ActiveMqDestination. This happens on the method purgeInactiveDestinationView(Map<ActiveMQDestination, NetworkDestinationView> map) which receives both outboundDestinationViewMap and inboundDestinationViewMap.
Thus when running for outboundDestinationViewMap if the last registration of a destination was actually of a inBound it will incorrectly delete the object name of and inboundDestination insead of the one from outboundDestination.
I am working on a fix and submitting a patch for this issue.
> Network of brokers on duplex mode reports InstanceAlreadyExistsException on already existing destinations
> ---------------------------------------------------------------------------------------------------------
>
> Key: AMQ-6052
> URL: https://issues.apache.org/jira/browse/AMQ-6052
> Project: ActiveMQ
> Issue Type: Bug
> Components: networkbridge
> Affects Versions: 5.11.3
> Environment: Linux
> Reporter: Pablo Lozano
> Labels: jmx, networkBridge, networkConnector
>
> When using a network of brokers apparently on duplex with destinations which were already created on each MBeanBridgeDestination.onOutboundMessage() and MBeanBridgeDestination.onInboundMessage() the bridge tries to register the MBean of a destination which has already been created.
> Here is a discussion that started but a ticket was not created.
> http://activemq.2283324.n4.nabble.com/Broker-log-full-of-Failed-to-register-queue-messages-td4685241.html
> Although this does not seem to impact the functionality of the application it creates a massive amount of logs as this message repeats for every received message.
> This are the important bits of my activeMQ configuration:
> {code:xml}
> <networkConnectors>
> <networkConnector name="mailSystemConnector" uri="multicast://default" conduitSubscriptions="true" duplex="true" >
> <dynamicallyIncludedDestinations>
> <queue physicalName="mailsystem.templateprocessor"/>
> <queue physicalName="DLQ.mailsystem.templateprocessor"/>
> </dynamicallyIncludedDestinations>
> </networkConnector>
> </networkConnectors>
> <destinations>
> <queue physicalName="SCE"/>
> <queue physicalName="mailsystem.templateprocessor"/>
> <queue physicalName="ActiveMQ.DLQ"/>
> </destinations>
> <managementContext>
> <managementContext createConnector="true"
> connectorPort="1091"
> jmxDomainName="org.apache.activemq"/>
> </managementContext>
> <!-- The transport connectors ActiveMQ will listen to -->
> <transportConnectors>
> <transportConnector name="openwire nio" uri="nio://0.0.0.0:61616" updateClusterClients="true"
> rebalanceClusterClients="true" updateClusterClientsOnRemove="true"/>
> <transportConnector name="openwireDiscovery" uri="tcp://0.0.0.0:0"
> discoveryUri="multicast://default" updateClusterClients="true"
> rebalanceClusterClients="true" updateClusterClientsOnRemove="true"/>
> <transportConnector name="stomp" uri="stomp://0.0.0.0:61613" updateClusterClients="true"
> rebalanceClusterClients="true" updateClusterClientsOnRemove="true"/>
> </transportConnectors>
> {code}
> And this is the output log generated:
> {noformat}
> 2015-11-18 15:43:10,497 [.69:41090@36731] WARN MBeanBridgeDestination - Failed to register queue://mailsystem.templateprocessor
> javax.management.InstanceAlreadyExistsException: org.apache.activemq:brokerName=mailsystemBroker,connector=duplexNetworkConnectors,networkConnectorName=#0,networkBridge=tcp_//10.211.2.69_41090,type=Broker,direction=inbound,destinationType=Queue,destinationName=mailsystem.templateprocessor
> at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
> at org.apache.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:380)
> at org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)
> at org.apache.activemq.network.MBeanBridgeDestination.onInboundMessage(MBeanBridgeDestination.java:97)
> at org.apache.activemq.network.MBeanNetworkListener.onInboundMessage(MBeanNetworkListener.java:115)
> at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceInboundMessage(DemandForwardingBridgeSupport.java:1680)
> at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceRemoteCommand(DemandForwardingBridgeSupport.java:649)
> at org.apache.activemq.network.DemandForwardingBridgeSupport$3.onCommand(DemandForwardingBridgeSupport.java:224)
> at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
> at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
> at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
> at org.apache.activemq.transport.AbstractInactivityMonitor.onCommand(AbstractInactivityMonitor.java:270)
> at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
> at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:214)
> at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:196)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
> {noformat}
> 2015-11-18 15:43:09,634 [Broker] Task-16] WARN MBeanBridgeDestination - Failed to register queue://mailsystem.templateprocessor
> javax.management.InstanceAlreadyExistsException: org.apache.activemq:brokerName=mailsystemBroker,connector=networkConnectors,networkConnectorName=mailSystemConnector,networkBridge=tcp_//10.211.2.70_36731,type=Broker,direction=outbound,destinationType=Queue,destinationName=mailsystem.templateprocessor
> at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
> at org.apache.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:380)
> at org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)
> at org.apache.activemq.network.MBeanBridgeDestination.onOutboundMessage(MBeanBridgeDestination.java:72)
> at org.apache.activemq.network.MBeanNetworkListener.onOutboundMessage(MBeanNetworkListener.java:107)
> at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceOutbound(DemandForwardingBridgeSupport.java:1673)
> at org.apache.activemq.network.DemandForwardingBridgeSupport.serviceLocalCommand(DemandForwardingBridgeSupport.java:1035)
> at org.apache.activemq.network.DemandForwardingBridgeSupport$2.onCommand(DemandForwardingBridgeSupport.java:206)
> at org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:116)
> at org.apache.activemq.transport.MutexTransport.onCommand(MutexTransport.java:50)
> at org.apache.activemq.transport.vm.VMTransport.doDispatch(VMTransport.java:138)
> at org.apache.activemq.transport.vm.VMTransport.dispatch(VMTransport.java:130)
> at org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:107)
> at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
> at org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
> at org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1419)
> at org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:938)
> at org.apache.activemq.broker.TransportConnection.iterate(TransportConnection.java:984)
> at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:133)
> at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)