ActiveMQ
  1. ActiveMQ
  2. AMQ-3359

UDP Transport connector listens on a random port number

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.4.0, 5.4.1, 5.4.2, 5.5.0
    • Fix Version/s: None
    • Component/s: Broker
    • Patch Info:
      Patch Available

      Description

      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() + "@"; }
      1. UpdTransportBindTest.java
        2 kB
        Christian Posta
      2. AMQ-3359.patch
        0.7 kB
        Amir Malekpour
      3. AMQ-3359.patch
        2 kB
        Christian Posta

        Activity

        Amir Malekpour created issue -
        Amir Malekpour made changes -
        Field Original Value New Value
        Description 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 but netstat shows another UDP port number. The reason is that as seen in the
        following block, the UdpTransport constructor does not read this.port from remoreLocation and only reads its address and leaves it to be zero. The solution is to add this line: this.port = remoteLocation.getPort();

        public UdpTransport(OpenWireFormat wireFormat, URI remoteLocation) throws UnknownHostException, IOException {
                this(wireFormat);
                this.targetAddress = createAddress(remoteLocation);
                description = remoteLocation.toString() + "@";
            }
        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 but netstat shows another UDP port number. The reason is that as seen in the
        following block, the UdpTransport constructor does not read this.port from remoreLocation and only reads its address and leaves the this.port to be zero. The solution is to add this line: this.port = remoteLocation.getPort();

        public UdpTransport(OpenWireFormat wireFormat, URI remoteLocation) throws UnknownHostException, IOException {
                this(wireFormat);
                this.targetAddress = createAddress(remoteLocation);
                description = remoteLocation.toString() + "@";
            }
        Amir Malekpour made changes -
        Attachment AMQ-3359.patch [ 12481592 ]
        Amir Malekpour made changes -
        Original Estimate 1m [ 60 ] 5m [ 300 ]
        Remaining Estimate 1m [ 60 ] 5m [ 300 ]
        Amir Malekpour made changes -
        Description 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 but netstat shows another UDP port number. The reason is that as seen in the
        following block, the UdpTransport constructor does not read this.port from remoreLocation and only reads its address and leaves the this.port to be zero. The solution is to add this line: this.port = remoteLocation.getPort();

        public UdpTransport(OpenWireFormat wireFormat, URI remoteLocation) throws UnknownHostException, IOException {
                this(wireFormat);
                this.targetAddress = createAddress(remoteLocation);
                description = remoteLocation.toString() + "@";
            }
        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() + "@";
        }
        Timothy Bish made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Not A Problem [ 8 ]
        Amir Malekpour made changes -
        Resolution Not A Problem [ 8 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Christian Posta made changes -
        Attachment AMQ-3359.patch [ 12509927 ]
        Christian Posta made changes -
        Attachment UpdTransportBindTest.java [ 12509928 ]
        Timothy Bish made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Cannot Reproduce [ 5 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Amir Malekpour
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development