Details
Description
Having some trouble using discovery with NMS 1.5.3-1.5.5 and broker apache-activemq-5.5.1-fuse-03-06.
Getting the following exception. Have also tried "discovery:(multicast://default)" and have tried with various broker connector configurations as seen in the docs, "0.0.0.0:0", "localhost:0" etc.
Apache.NMS.NMSException occurred Message=Could not connect to broker URL: discovery:multicast://default. Reason: Specified argument was out of the range of valid values. Parameter name: port Source=Apache.NMS.ActiveMQ StackTrace: at Apache.NMS.ActiveMQ.ConnectionFactory.CreateActiveMQConnection(String userName, String password) at Apache.NMS.ActiveMQ.ConnectionFactory.CreateActiveMQConnection() at Apache.NMS.ActiveMQ.ConnectionFactory.CreateConnection() at BrokerOutageTests.Program.Main(String[] args) in D:\Projects\NmsFailoverTest\src\BrokerOutageTests\Program.cs:line 10 InnerException: System.ArgumentOutOfRangeException Message=Specified argument was out of the range of valid values. Parameter name: port Source=System ParamName=port StackTrace: at System.Net.IPEndPoint..ctor(IPAddress address, Int32 port) at Apache.NMS.ActiveMQ.Transport.Discovery.Multicast.MulticastDiscoveryAgent.TryToConnectSocket() at Apache.NMS.ActiveMQ.Transport.Discovery.Multicast.MulticastDiscoveryAgent.Start() at Apache.NMS.ActiveMQ.Transport.Discovery.DiscoveryTransportFactory.CreateTransport(Uri location) at Apache.NMS.ActiveMQ.Transport.TransportFactory.CreateTransport(Uri location) at Apache.NMS.ActiveMQ.ConnectionFactory.CreateActiveMQConnection(String userName, String password) InnerException:
using Apache.NMS.ActiveMQ; namespace BrokerOutageTests { class Program { static void Main(string[] args) { ConnectionFactory cf = new ConnectionFactory("discovery:multicast://default"); cf.CreateConnection(); } } }
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> <broker xmlns="http://activemq.apache.org/schema/core" brokerName="broker1" dataDirectory="broker1data" persistent="false"> <destinationPolicy> <policyMap> <policyEntries> <policyEntry topic=">" producerFlowControl="false" memoryLimit="100mb" advisoryForDiscardingMessages="true"> <pendingMessageLimitStrategy> <constantPendingMessageLimitStrategy limit="2000"/> </pendingMessageLimitStrategy> <pendingSubscriberPolicy> <vmCursor /> </pendingSubscriberPolicy> </policyEntry> <policyEntry queue=">" producerFlowControl="false" memoryLimit="100mb"> </policyEntry> </policyEntries> </policyMap> </destinationPolicy> <managementContext> <managementContext createConnector="false"/> </managementContext> <persistenceAdapter> <memoryPersistenceAdapter /> </persistenceAdapter> <plugins> <statisticsBrokerPlugin /> </plugins> <transportConnectors> <transportConnector name="openwire" uri="tcp://0.0.0.0:61616" discoveryUri="multicast://default" /> </transportConnectors> </broker> </beans>