UDP Transport connector listens on a random port number.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

UDP Transport connector listens on a random port number.

Amir
Hi all,

I'm having problem getting ActiveMQ 5.4.* and 5.5 to run properly with UDP transport connector. What happens is that the broker listens on a random UDP port number instead of the one I configure in the URI. The port number seems to be randomly chosen, since it changes each time the broker is restarted. Interestingly, the management console indicates that the broker's listening on the configured port number but netstat shows another UDP port number. Any idea ?

-Amir
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

dejanb
Hi,

any particular reason for using UDP protocol?

Regards
--
Dejan Bosanac - http://twitter.com/dejanb
-----------------
The experts in open source integration and messaging - http://fusesource.com
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net

Connect at CamelOne <http://camelone.com/> May 24-26

The Open Source Integration Conference



On Fri, Jun 3, 2011 at 10:01 AM, Amir <[hidden email]> wrote:

> Hi all,
>
> I'm having problem getting ActiveMQ 5.4.* and 5.5 to run properly with UDP
> transport connector. What happens is that the broker listens to a random
> UDP
> port number instead of the one I configure in the URI. The port number
> seems
> to be randomly chosen, since it changes each time the broker is restarted.
> Interestingly, the management console indicates that the broker's listening
> on the configured port number but netstat shows another UDP port number.
> Any
> idea ?
>
> -Amir
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/UDP-Transport-connector-binds-to-a-random-port-number-tp3570237p3570237.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

Amir
Well, its for research purposes. We've developed an end-to-end reliability protocol for unreliable pub/sub and we've decided to evaluate the protocol with ActiveMQ in unreliable settings. (UDP).
At this point I'm almost certain this is a bug in ActiveMQ. I was hoping 5.5 would fix the bug but it still exists, since 5.4 or maybe even before.

-Amir
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

gtully
Have a peek at the source: doBind in
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/udp/UdpTransportFactory.java?view=markup

You may be able to easily see what is going on, or not going on :-)

Please open an issue to track this and if you have a solution, please
attach a patch.


On 3 June 2011 13:37, Amir <[hidden email]> wrote:

> Well, its for research purposes. We've developed an end-to-end reliability
> protocol for unreliable pub/sub and we've decided to evaluate the protocol
> with ActiveMQ in unreliable settings. (UDP).
> At this point I'm almost certain this is a bug in ActiveMQ. I was hoping 5.5
> would fix the bug but it still exists, since 5.4 or maybe even before.
>
> -Amir
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/UDP-Transport-connector-listens-on-a-random-port-number-tp3570237p3570726.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



--
http://fusesource.com
http://blog.garytully.com
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

Amir
Thanks Gary,

Using the the pointer you gave me I found the bug in ActiveMQ that was causing this problem. I'll submit a patch soon.

-Amir











Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

Amir
By the way, as a side note, its pretty weird this bug hadn't been discovered before because UDP actually did not work at all (more precisely it worked, but not in a usable way). So, I think there is a serious lack of UDP tests in the current test collection.

-Amir
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

gtully
think that is the case, new tests are always welcome. submit one with
your patch, it will protect your changes into the future.

On 6 June 2011 17:54, Amir <[hidden email]> wrote:

> By the way, as a side note, its pretty weird this bug hadn't been discovered
> before because UDP actually did not work at all. So, I think there is a
> serious lack of UDP tests in the current test collection.
>
> -Amir
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/UDP-Transport-connector-listens-on-a-random-port-number-tp3570237p3577438.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



--
http://fusesource.com
http://blog.garytully.com
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

ceposta
In reply to this post by Amir
Amir,

I see you have a JIRA still opened for this issue. Can you confirm this is still an issue?
Reply | Threaded
Open this post in threaded view
|

Re: UDP Transport connector binds to a random port number.

ceposta
Amir,

I figured it out. The patch you submitted was not the correct one, but very much on the right track. I'll update the JIRA with what I found. As Gary mentioned, this module could use some unit tests, so I'll write those as well.

The link to your JIRA issue is here: https://issues.apache.org/jira/browse/AMQ-3359?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel#issue-tabs

Thanks,
Christian