Subject: | Net::STOMP::Client::Connection bug |
Date: | Thu, 25 Jul 2013 20:29:56 +0000 |
To: | "bug-Net-STOMP-Client [...] rt.cpan.org" <bug-Net-STOMP-Client [...] rt.cpan.org> |
From: | Felton‚ Brian <Brian.Felton [...] savvis.com> |
Greetings,
Distribution Name: Net-STOMP-Client-2.1_1<http://search.cpan.org/%7Elcons/Net-STOMP-Client/lib/Net/STOMP/Client.pm>
Perl Versions Tested: 5.14.2 (cygwin), 5.16.2 (x86_64-linux-thread-multi)
Operating Systems: Windows 7, RHEL 5.5
I’ve been working on testing ActiveMQ’s failover capabilities, so I threw together a test client using Net::STOMP::Client. In providing a failover URI that adheres to the ActiveMQ Failover Spec<http://activemq.apache.org/failover-transport-reference.html>, I found that Connection determined it was invalid. The URI provided was of the format “failover:(192.168.1.1:61613,192.168.1.2:61613)?maxReconnectAttempts=1”. Upon running, I get the following error:
[root@localhost perl]# ./FailoverTest.pl
Connection failed: Sleeping 10 seconds and retrying...
Error! - Retry attempts exhausted - unexpected server uri: failover:(tcp://10.12.194.210:61613,tcp://10.12.194.212:61613)?maxReconnectAttempts=1
In digging through Connection.pm (version 2.1), I found the following check in _parse_uri:
} elsif ($uri =~ m{ ^ failover \: (?:\/\/)? \( ([a-z0-9\.\-\:\/\,]+) \)
( \? [a-z0-9\.\=\-\&]+ ) ? $ }x) {
The issue is specifically with the part of the regex that checks for transport options after the ‘?’ ([a-z0-9\.\=\-\&]+). With the addition of ‘A-Z’ to the list of available characters, the problem is fixed (or, I suppose, by changing }x to }xi). It probably also wouldn’t hurt to allow uppercase letters in the hostnames, although that’s not a blocker.
I tried passing all lowercase versions of the various transport options, but AMQ (at least version 5.8.0) does not recognize them.
If there are any additional questions or details required, please let me know. I can provide a test client if needed, but I think the above should be adequate to identify the issue and some possible resolutions.
Many thanks,
Brian Felton | Technical Lead, GSD
Savvis, A CenturyLink Company
575 Maryville Centre Drive, St. Louis, MO 63141
Office: 314.579.8615 | Mobile: 314.651.6527
E-mail: brian.felton@savvis.com<mailto:brian.felton@savvis.com>
www.savvis.com<http://www.savvis.com/>
This message contains information which may be confidential and/or privileged. Unless you are the intended recipient (or authorized to receive for the intended recipient), you may not read, use, copy or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail and delete the message and any attachment(s) thereto without retaining any copies.