You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Tianchi <ti...@gmail.com> on 2011/05/13 00:00:36 UTC

stomp exception when configuring failover URL

Hi,

I am using ServiceMix ESB, version: apache-servicemix-4.3.1-fuse-01-09 and
activemq 5.4.2.fuse-03-09 and trying to set up failover for two queues using
JDBC lock system. On the PHP client side, I used the following command to
make a connection: 

$con=new
stomp("failover://(tcp://localhost:61213,tcp://192.168.10.8:61213)?randomize=false");

It works perfectly. 

But when I tried to use more than one transport options like: 

$con=new
stomp("failover://(tcp://localhost:61213,tcp://192.168.10.8:61213)?randomize=false&backup=true");

It throws an exception: 
StompException: Bad Broker URL
failover://(tcp://localhost:61213,tcp://192.168.10.8:61213)?randomize=false&backup=true

Anyone has idea on how to fix it? 

Thanks.



--
View this message in context: http://activemq.2283324.n4.nabble.com/stomp-exception-when-configuring-failover-URL-tp3518843p3518843.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: stomp exception when configuring failover URL

Posted by Dejan Bosanac <de...@nighttale.net>.
Thanks for this patch. I applied it to
http://stomp.fusesource.org/documentation/php/book.html which is the newer
version of this PHP client.

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, May 13, 2011 at 7:12 PM, Tianchi <ti...@gmail.com> wrote:

> Thanks for your quick reply.  I just fixed this problem.
>
> This seems to be a bug in stomp.php
>
> http://code.google.com/p/stompcli/source/browse/trunk/src/main/php5/Stomp.php
>
> line 88: the regular expr didn’t put in & as one of the characters
> accepted.
> You can simply fix it by putting in a & $pattern =
> "|^(([a-zA-Z]+)://)+\(*([a-zA-Z0-9\.:/i,-]+)\)*\??([a-zA-Z0-9=&]*)$|i";
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/stomp-exception-when-configuring-failover-URL-tp3518843p3520718.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: stomp exception when configuring failover URL

Posted by Tianchi <ti...@gmail.com>.
Thanks for your quick reply.  I just fixed this problem. 

This seems to be a bug in stomp.php
http://code.google.com/p/stompcli/source/browse/trunk/src/main/php5/Stomp.php

line 88: the regular expr didn’t put in & as one of the characters accepted.
You can simply fix it by putting in a & $pattern =
"|^(([a-zA-Z]+)://)+\(*([a-zA-Z0-9\.:/i,-]+)\)*\??([a-zA-Z0-9=&]*)$|i";

--
View this message in context: http://activemq.2283324.n4.nabble.com/stomp-exception-when-configuring-failover-URL-tp3518843p3520718.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: stomp exception when configuring failover URL

Posted by Stan Lewis <sl...@fusesource.com>.
Can you try escaping the '&' character, i.e. replace it with "&amp;",
or pass the URL through htmlspecialchars perhaps?

On Thu, May 12, 2011 at 6:00 PM, Tianchi <ti...@gmail.com> wrote:
> Hi,
>
> I am using ServiceMix ESB, version: apache-servicemix-4.3.1-fuse-01-09 and
> activemq 5.4.2.fuse-03-09 and trying to set up failover for two queues using
> JDBC lock system. On the PHP client side, I used the following command to
> make a connection:
>
> $con=new
> stomp("failover://(tcp://localhost:61213,tcp://192.168.10.8:61213)?randomize=false");
>
> It works perfectly.
>
> But when I tried to use more than one transport options like:
>
> $con=new
> stomp("failover://(tcp://localhost:61213,tcp://192.168.10.8:61213)?randomize=false&backup=true");
>
> It throws an exception:
> StompException: Bad Broker URL
> failover://(tcp://localhost:61213,tcp://192.168.10.8:61213)?randomize=false&backup=true
>
> Anyone has idea on how to fix it?
>
> Thanks.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/stomp-exception-when-configuring-failover-URL-tp3518843p3518843.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>