You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Jason Sherman (Updated) (JIRA)" <ji...@apache.org> on 2011/11/30 22:15:40 UTC

[jira] [Updated] (AMQ-3614) Unable to generate unique id when range of ports are blocked - org.apache.activemq.util.IdGenerator

     [ https://issues.apache.org/jira/browse/AMQ-3614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Sherman updated AMQ-3614:
-------------------------------

    Attachment: AMQ3614.patch

Attaching patch with fallback strategy if unable to bind to port
                
> Unable to generate unique id when range of ports are blocked - org.apache.activemq.util.IdGenerator
> ---------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-3614
>                 URL: https://issues.apache.org/jira/browse/AMQ-3614
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.5.1
>            Reporter: Jason Sherman
>         Attachments: AMQ3614.patch
>
>
> org.apache.activemq.util.IdGenerator is unable to generate a unique id if a range of ports have been block.
> Currently there is only one strategy create this id if the canAccessSystemProps condition is true:
> {code}
> if (canAccessSystemProps) {
>             try {
>                 hostName = InetAddressUtil.getLocalHostName();
>                 ServerSocket ss = new ServerSocket(0);
>                 stub = "-" + ss.getLocalPort() + "-" + System.currentTimeMillis() + "-";
>                 Thread.sleep(100);
>                 ss.close();
>             } catch (Exception ioe) {
>                 LOG.warn("could not generate unique stub", ioe);
>             }
>         } else {
>             hostName = "localhost";
>             stub = "-1-" + System.currentTimeMillis() + "-";
>         }
> {code}
> No fallback strategy has been implemented if the canAccessSystemProp evaluates to true

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira