Skip to content

container/src/main/java/org/apache/rocketmq/container/InnerBrokerController.java:57 - ephemeral broker ports are advertised as port 0 #11549

Open

Description

@Metastarx

BrokerContainerProcessor.addBroker() accepts brokerConfig.listenPort without validating it at container/src/main/java/org/apache/rocketmq/container/BrokerContainerProcessor.java:118-126. When it is 0, InnerBrokerController.initializeRemotingServer() creates the main sub-server on port 0 and the fast sub-server on port -2 at lines 49-57. SubRemotingServer.start() normalizes negative ports to 0 and replaces port 0 with an OS-assigned port at remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingServer.java:746-755, but InnerBrokerController.getBrokerAddr() still formats brokerConfig.getListenPort() at container/src/main/java/org/apache/rocketmq/container/InnerBrokerController.java:147-149.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions