You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by Motl <mo...@orcsoftware.com> on 2007/11/13 10:38:37 UTC

retrieve activemq broker's port

Hi,

When creating a BrokerService, zero port could be specified,  telling the
broker application to bind on any free port.
Is it possible to retrieve the assigned port afterwards?
-- 
View this message in context: http://www.nabble.com/retrieve-activemq-broker%27s-port-tf4796743s2354.html#a13722645
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: retrieve activemq broker's port

Posted by Motl <mo...@orcsoftware.com>.
It works, fine.
BTW, I used getUri() instead.


jlim wrote:
> 
> Hi,
> 
> try retrieving the transport connectors  (BrokerService -  
> getTransportConnectors() ) from the broker  then we should be able to 
> get the port  from  TransportConnector - getConnectUri().getPort() for 
> each of the connectors configured to the broker.
> 
> 
> Regards,
> Jonas
> 
> 
> Motl wrote:
>> Hi,
>>
>> When creating a BrokerService, zero port could be specified,  telling the
>> broker application to bind on any free port.
>> Is it possible to retrieve the assigned port afterwards?
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/retrieve-activemq-broker%27s-port-tf4796743s2354.html#a13731432
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Re: retrieve activemq broker's port

Posted by Jonas Lim <jl...@exist.com>.
Hi,

try retrieving the transport connectors  (BrokerService -  
getTransportConnectors() ) from the broker  then we should be able to 
get the port  from  TransportConnector - getConnectUri().getPort() for 
each of the connectors configured to the broker.


Regards,
Jonas


Motl wrote:
> Hi,
>
> When creating a BrokerService, zero port could be specified,  telling the
> broker application to bind on any free port.
> Is it possible to retrieve the assigned port afterwards?
>   

Re: retrieve activemq broker's port

Posted by Hiram Chirino <hi...@hiramchirino.com>.
If you assign a discovery agent to the transport then the port will be
advertised by the discovery agent too.

On Nov 13, 2007 4:38 AM, Motl <mo...@orcsoftware.com> wrote:
>
> Hi,
>
> When creating a BrokerService, zero port could be specified,  telling the
> broker application to bind on any free port.
> Is it possible to retrieve the assigned port afterwards?
> --
> View this message in context: http://www.nabble.com/retrieve-activemq-broker%27s-port-tf4796743s2354.html#a13722645
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
>



-- 
Regards,
Hiram

Blog: http://hiramchirino.com

Open Source SOA
http://open.iona.com