Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 111C74B53 for ; Tue, 5 Jul 2011 15:11:42 +0000 (UTC) Received: (qmail 17335 invoked by uid 500); 5 Jul 2011 15:11:41 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 17166 invoked by uid 500); 5 Jul 2011 15:11:41 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 17156 invoked by uid 99); 5 Jul 2011 15:11:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2011 15:11:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jul 2011 15:11:38 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F3EBB43BCD for ; Tue, 5 Jul 2011 15:11:16 +0000 (UTC) Date: Tue, 5 Jul 2011 15:11:16 +0000 (UTC) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Message-ID: <134248047.861.1309878676995.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <195676669.1024.1307380739120.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AMQ-3359) UDP Transport connector listens on a random port number MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059944#comment-13059944 ] Timothy Bish commented on AMQ-3359: ----------------------------------- After some further investigation this doesn't seem to be an issue. The broker doesn't call the constructor that's referenced in this issue when it creates its transport server, it calls the Constructor taking a wireFormat and port number to bind to. The constructor referenced uses the remoteLocation address to connect to the broker as expected. > UDP Transport connector listens on a random port number > ------------------------------------------------------- > > Key: AMQ-3359 > URL: https://issues.apache.org/jira/browse/AMQ-3359 > Project: ActiveMQ > Issue Type: Bug > Components: Broker > Affects Versions: 5.4.0, 5.4.1, 5.4.2, 5.5.0 > Reporter: Amir Malekpour > Labels: broker, port, transport, udp > Attachments: AMQ-3359.patch > > Original Estimate: 5m > Remaining Estimate: 5m > > The broker listens on a random UDP port number instead of the one configure in the URI. The port number changes each time the broker is restarted. However, the management console indicates that the broker's listening on the configured port number while it is not the case (netstat shows another UDP port number). The reason is that (as seen in the following block) the UdpTransport constructor does not assign "this.port" from remoteLocation but only reads the address and leaves "this.port" to be zero. Subsequently, Java API picks any available port number when it is creating the DatagraSocket. The solution is to add this line: "this.port = remoteLocation.getPort();" to the following constructor as seen in the accompanying patch. > public UdpTransport(OpenWireFormat wireFormat, URI remoteLocation) throws UnknownHostException, IOException { > this(wireFormat); > this.targetAddress = createAddress(remoteLocation); > description = remoteLocation.toString() + "@"; > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira