You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jamie McCrindle <ja...@gmail.com> on 2010/01/14 12:09:30 UTC

ActiveMQ FuseSource Stomp large payloads problem

Hi All,

It appears that the ActiveMQ FuseSource Stomp PHP client can't handle
messages larger than 1024 bytes. The code is as follows in Stomp.php:

        $rb = 1024;
        $data = '';
        $end = false;

        do {
            $read = fread($this->_socket, $rb);
            if ($read === false) {
                $this->_reconnect();
                return $this->readFrame();
            }
            $data .= $read;
            if (strpos($data, "\x00") !== false) {
                $end = true;
                $data = rtrim($data, "\n");
            }
            $len = strlen($data);
        } while ($len < 2 || $end == false);

If I set $rb to a larger value e.g. 1048576, it consumes the whole
message and works as expected. What appears to be happening is that
the first 1024 bytes are read, the loop exit condition is not met and
then the client hangs on the $read = fread($this->_socket, $rb); line.

I'm using:

Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
the irony is that by upgrading I save disk space... *sigh*)
PHP 5.2.11

Let me know if I should publish this to the fusesource dev mailing list instead

cheers,
j.

Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Rob Davies <ra...@gmail.com>.
sry - Jaime - fuse jira better for STOMP
On 19 Jan 2010, at 16:58, Jamie McCrindle wrote:

> Ah, ok, I'll raise it in the ActiveMQ jira, I was just directed to the
> FuseSource jira
>
> cheers,
> j.
>
> On Tue, Jan 19, 2010 at 4:56 PM, Rob Davies <ra...@gmail.com>  
> wrote:
>> You just need to register in jira -
>> https://issues.apache.org/activemq/secure/Signup!default.jspa -  
>> then you
>> should be able to raise a bug
>> On 19 Jan 2010, at 16:49, Jamie McCrindle wrote:
>>
>>> Hiya,
>>>
>>> We've worked around the problem by increasing the buffer size but  
>>> it's
>>> not the best solution. I'd like to raise a bug in Jira but it's for
>>> authorized users only. Is there another way to get it in?
>>>
>>> cheers,
>>> j.
>>>
>>> On Thu, Jan 14, 2010 at 11:30 AM, Jamie McCrindle
>>> <ja...@gmail.com> wrote:
>>>>
>>>> Will post an issue. I'll see if I can submit a patch as well
>>>>
>>>> cheers,
>>>> j.
>>>>
>>>> ps: I've cross posted to stackoverflow to see if the php geniuses  
>>>> over
>>>> there have some ideas.
>>>>
>>>> On Thu, Jan 14, 2010 at 11:26 AM, Dejan Bosanac <dejan@nighttale.net 
>>>> >
>>>> wrote:
>>>>>
>>>>> Hi Jamie,
>>>>>
>>>>> thanks for pointing to this issue. The best approach is to file  
>>>>> a bug in
>>>>> project's Jira (http://fusesource.com/issues/browse/STOMP) and  
>>>>> we'll
>>>>> take it
>>>>> from there (a patch that solves it would be even better).
>>>>>
>>>>> Cheers
>>>>> --
>>>>> Dejan Bosanac - http://twitter.com/dejanb
>>>>>
>>>>> Open Source Integration - http://fusesource.com/
>>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>>> Blog - http://www.nighttale.net
>>>>>
>>>>>
>>>>> On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
>>>>> <ja...@gmail.com>wrote:
>>>>>
>>>>>> Hi All,
>>>>>>
>>>>>> It appears that the ActiveMQ FuseSource Stomp PHP client can't  
>>>>>> handle
>>>>>> messages larger than 1024 bytes. The code is as follows in  
>>>>>> Stomp.php:
>>>>>>
>>>>>>       $rb = 1024;
>>>>>>       $data = '';
>>>>>>       $end = false;
>>>>>>
>>>>>>       do {
>>>>>>           $read = fread($this->_socket, $rb);
>>>>>>           if ($read === false) {
>>>>>>               $this->_reconnect();
>>>>>>               return $this->readFrame();
>>>>>>           }
>>>>>>           $data .= $read;
>>>>>>           if (strpos($data, "\x00") !== false) {
>>>>>>               $end = true;
>>>>>>               $data = rtrim($data, "\n");
>>>>>>           }
>>>>>>           $len = strlen($data);
>>>>>>       } while ($len < 2 || $end == false);
>>>>>>
>>>>>> If I set $rb to a larger value e.g. 1048576, it consumes the  
>>>>>> whole
>>>>>> message and works as expected. What appears to be happening is  
>>>>>> that
>>>>>> the first 1024 bytes are read, the loop exit condition is not  
>>>>>> met and
>>>>>> then the client hangs on the $read = fread($this->_socket,  
>>>>>> $rb); line.
>>>>>>
>>>>>> I'm using:
>>>>>>
>>>>>> Mac OS X Leopard (yeah, I'll upgrade when I have more disk  
>>>>>> space...
>>>>>> the irony is that by upgrading I save disk space... *sigh*)
>>>>>> PHP 5.2.11
>>>>>>
>>>>>> Let me know if I should publish this to the fusesource dev  
>>>>>> mailing list
>>>>>> instead
>>>>>>
>>>>>> cheers,
>>>>>> j.
>>>>>>
>>>>>
>>>>
>>
>> Rob Davies
>> http://twitter.com/rajdavies
>> I work here: http://fusesource.com
>> My Blog: http://rajdavies.blogspot.com/
>> I'm writing this: http://www.manning.com/snyder/
>>
>>
>>
>>
>>
>>

Rob Davies
http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/






Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi Jamie,

you can register fuse account here https://fusesource.com/login

and then you should be able to submit issues to stomp project directly
http://fusesource.com/issues/browse/STOMP

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Tue, Jan 19, 2010 at 5:58 PM, Jamie McCrindle
<ja...@gmail.com>wrote:

> Ah, ok, I'll raise it in the ActiveMQ jira, I was just directed to the
> FuseSource jira
>
> cheers,
> j.
>
> On Tue, Jan 19, 2010 at 4:56 PM, Rob Davies <ra...@gmail.com> wrote:
> > You just need to register in jira -
> > https://issues.apache.org/activemq/secure/Signup!default.jspa - then you
> > should be able to raise a bug
> > On 19 Jan 2010, at 16:49, Jamie McCrindle wrote:
> >
> >> Hiya,
> >>
> >> We've worked around the problem by increasing the buffer size but it's
> >> not the best solution. I'd like to raise a bug in Jira but it's for
> >> authorized users only. Is there another way to get it in?
> >>
> >> cheers,
> >> j.
> >>
> >> On Thu, Jan 14, 2010 at 11:30 AM, Jamie McCrindle
> >> <ja...@gmail.com> wrote:
> >>>
> >>> Will post an issue. I'll see if I can submit a patch as well
> >>>
> >>> cheers,
> >>> j.
> >>>
> >>> ps: I've cross posted to stackoverflow to see if the php geniuses over
> >>> there have some ideas.
> >>>
> >>> On Thu, Jan 14, 2010 at 11:26 AM, Dejan Bosanac <de...@nighttale.net>
> >>> wrote:
> >>>>
> >>>> Hi Jamie,
> >>>>
> >>>> thanks for pointing to this issue. The best approach is to file a bug
> in
> >>>> project's Jira (http://fusesource.com/issues/browse/STOMP) and we'll
> >>>> take it
> >>>> from there (a patch that solves it would be even better).
> >>>>
> >>>> Cheers
> >>>> --
> >>>> Dejan Bosanac - http://twitter.com/dejanb
> >>>>
> >>>> Open Source Integration - http://fusesource.com/
> >>>> ActiveMQ in Action - http://www.manning.com/snyder/
> >>>> Blog - http://www.nighttale.net
> >>>>
> >>>>
> >>>> On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
> >>>> <ja...@gmail.com>wrote:
> >>>>
> >>>>> Hi All,
> >>>>>
> >>>>> It appears that the ActiveMQ FuseSource Stomp PHP client can't handle
> >>>>> messages larger than 1024 bytes. The code is as follows in Stomp.php:
> >>>>>
> >>>>>       $rb = 1024;
> >>>>>       $data = '';
> >>>>>       $end = false;
> >>>>>
> >>>>>       do {
> >>>>>           $read = fread($this->_socket, $rb);
> >>>>>           if ($read === false) {
> >>>>>               $this->_reconnect();
> >>>>>               return $this->readFrame();
> >>>>>           }
> >>>>>           $data .= $read;
> >>>>>           if (strpos($data, "\x00") !== false) {
> >>>>>               $end = true;
> >>>>>               $data = rtrim($data, "\n");
> >>>>>           }
> >>>>>           $len = strlen($data);
> >>>>>       } while ($len < 2 || $end == false);
> >>>>>
> >>>>> If I set $rb to a larger value e.g. 1048576, it consumes the whole
> >>>>> message and works as expected. What appears to be happening is that
> >>>>> the first 1024 bytes are read, the loop exit condition is not met and
> >>>>> then the client hangs on the $read = fread($this->_socket, $rb);
> line.
> >>>>>
> >>>>> I'm using:
> >>>>>
> >>>>> Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
> >>>>> the irony is that by upgrading I save disk space... *sigh*)
> >>>>> PHP 5.2.11
> >>>>>
> >>>>> Let me know if I should publish this to the fusesource dev mailing
> list
> >>>>> instead
> >>>>>
> >>>>> cheers,
> >>>>> j.
> >>>>>
> >>>>
> >>>
> >
> > Rob Davies
> > http://twitter.com/rajdavies
> > I work here: http://fusesource.com
> > My Blog: http://rajdavies.blogspot.com/
> > I'm writing this: http://www.manning.com/snyder/
> >
> >
> >
> >
> >
> >
>

Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Jamie McCrindle <ja...@gmail.com>.
Ah, ok, I'll raise it in the ActiveMQ jira, I was just directed to the
FuseSource jira

cheers,
j.

On Tue, Jan 19, 2010 at 4:56 PM, Rob Davies <ra...@gmail.com> wrote:
> You just need to register in jira -
> https://issues.apache.org/activemq/secure/Signup!default.jspa - then you
> should be able to raise a bug
> On 19 Jan 2010, at 16:49, Jamie McCrindle wrote:
>
>> Hiya,
>>
>> We've worked around the problem by increasing the buffer size but it's
>> not the best solution. I'd like to raise a bug in Jira but it's for
>> authorized users only. Is there another way to get it in?
>>
>> cheers,
>> j.
>>
>> On Thu, Jan 14, 2010 at 11:30 AM, Jamie McCrindle
>> <ja...@gmail.com> wrote:
>>>
>>> Will post an issue. I'll see if I can submit a patch as well
>>>
>>> cheers,
>>> j.
>>>
>>> ps: I've cross posted to stackoverflow to see if the php geniuses over
>>> there have some ideas.
>>>
>>> On Thu, Jan 14, 2010 at 11:26 AM, Dejan Bosanac <de...@nighttale.net>
>>> wrote:
>>>>
>>>> Hi Jamie,
>>>>
>>>> thanks for pointing to this issue. The best approach is to file a bug in
>>>> project's Jira (http://fusesource.com/issues/browse/STOMP) and we'll
>>>> take it
>>>> from there (a patch that solves it would be even better).
>>>>
>>>> Cheers
>>>> --
>>>> Dejan Bosanac - http://twitter.com/dejanb
>>>>
>>>> Open Source Integration - http://fusesource.com/
>>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>>> Blog - http://www.nighttale.net
>>>>
>>>>
>>>> On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
>>>> <ja...@gmail.com>wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> It appears that the ActiveMQ FuseSource Stomp PHP client can't handle
>>>>> messages larger than 1024 bytes. The code is as follows in Stomp.php:
>>>>>
>>>>>       $rb = 1024;
>>>>>       $data = '';
>>>>>       $end = false;
>>>>>
>>>>>       do {
>>>>>           $read = fread($this->_socket, $rb);
>>>>>           if ($read === false) {
>>>>>               $this->_reconnect();
>>>>>               return $this->readFrame();
>>>>>           }
>>>>>           $data .= $read;
>>>>>           if (strpos($data, "\x00") !== false) {
>>>>>               $end = true;
>>>>>               $data = rtrim($data, "\n");
>>>>>           }
>>>>>           $len = strlen($data);
>>>>>       } while ($len < 2 || $end == false);
>>>>>
>>>>> If I set $rb to a larger value e.g. 1048576, it consumes the whole
>>>>> message and works as expected. What appears to be happening is that
>>>>> the first 1024 bytes are read, the loop exit condition is not met and
>>>>> then the client hangs on the $read = fread($this->_socket, $rb); line.
>>>>>
>>>>> I'm using:
>>>>>
>>>>> Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
>>>>> the irony is that by upgrading I save disk space... *sigh*)
>>>>> PHP 5.2.11
>>>>>
>>>>> Let me know if I should publish this to the fusesource dev mailing list
>>>>> instead
>>>>>
>>>>> cheers,
>>>>> j.
>>>>>
>>>>
>>>
>
> Rob Davies
> http://twitter.com/rajdavies
> I work here: http://fusesource.com
> My Blog: http://rajdavies.blogspot.com/
> I'm writing this: http://www.manning.com/snyder/
>
>
>
>
>
>

Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Rob Davies <ra...@gmail.com>.
You just need to register in jira - https://issues.apache.org/activemq/secure/Signup!default.jspa 
  - then you should be able to raise a bug
On 19 Jan 2010, at 16:49, Jamie McCrindle wrote:

> Hiya,
>
> We've worked around the problem by increasing the buffer size but it's
> not the best solution. I'd like to raise a bug in Jira but it's for
> authorized users only. Is there another way to get it in?
>
> cheers,
> j.
>
> On Thu, Jan 14, 2010 at 11:30 AM, Jamie McCrindle
> <ja...@gmail.com> wrote:
>> Will post an issue. I'll see if I can submit a patch as well
>>
>> cheers,
>> j.
>>
>> ps: I've cross posted to stackoverflow to see if the php geniuses  
>> over
>> there have some ideas.
>>
>> On Thu, Jan 14, 2010 at 11:26 AM, Dejan Bosanac  
>> <de...@nighttale.net> wrote:
>>> Hi Jamie,
>>>
>>> thanks for pointing to this issue. The best approach is to file a  
>>> bug in
>>> project's Jira (http://fusesource.com/issues/browse/STOMP) and  
>>> we'll take it
>>> from there (a patch that solves it would be even better).
>>>
>>> Cheers
>>> --
>>> Dejan Bosanac - http://twitter.com/dejanb
>>>
>>> Open Source Integration - http://fusesource.com/
>>> ActiveMQ in Action - http://www.manning.com/snyder/
>>> Blog - http://www.nighttale.net
>>>
>>>
>>> On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
>>> <ja...@gmail.com>wrote:
>>>
>>>> Hi All,
>>>>
>>>> It appears that the ActiveMQ FuseSource Stomp PHP client can't  
>>>> handle
>>>> messages larger than 1024 bytes. The code is as follows in  
>>>> Stomp.php:
>>>>
>>>>        $rb = 1024;
>>>>        $data = '';
>>>>        $end = false;
>>>>
>>>>        do {
>>>>            $read = fread($this->_socket, $rb);
>>>>            if ($read === false) {
>>>>                $this->_reconnect();
>>>>                return $this->readFrame();
>>>>            }
>>>>            $data .= $read;
>>>>            if (strpos($data, "\x00") !== false) {
>>>>                $end = true;
>>>>                $data = rtrim($data, "\n");
>>>>            }
>>>>            $len = strlen($data);
>>>>        } while ($len < 2 || $end == false);
>>>>
>>>> If I set $rb to a larger value e.g. 1048576, it consumes the whole
>>>> message and works as expected. What appears to be happening is that
>>>> the first 1024 bytes are read, the loop exit condition is not met  
>>>> and
>>>> then the client hangs on the $read = fread($this->_socket, $rb);  
>>>> line.
>>>>
>>>> I'm using:
>>>>
>>>> Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
>>>> the irony is that by upgrading I save disk space... *sigh*)
>>>> PHP 5.2.11
>>>>
>>>> Let me know if I should publish this to the fusesource dev  
>>>> mailing list
>>>> instead
>>>>
>>>> cheers,
>>>> j.
>>>>
>>>
>>

Rob Davies
http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/






Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Jamie McCrindle <ja...@gmail.com>.
Hiya,

We've worked around the problem by increasing the buffer size but it's
not the best solution. I'd like to raise a bug in Jira but it's for
authorized users only. Is there another way to get it in?

cheers,
j.

On Thu, Jan 14, 2010 at 11:30 AM, Jamie McCrindle
<ja...@gmail.com> wrote:
> Will post an issue. I'll see if I can submit a patch as well
>
> cheers,
> j.
>
> ps: I've cross posted to stackoverflow to see if the php geniuses over
> there have some ideas.
>
> On Thu, Jan 14, 2010 at 11:26 AM, Dejan Bosanac <de...@nighttale.net> wrote:
>> Hi Jamie,
>>
>> thanks for pointing to this issue. The best approach is to file a bug in
>> project's Jira (http://fusesource.com/issues/browse/STOMP) and we'll take it
>> from there (a patch that solves it would be even better).
>>
>> Cheers
>> --
>> Dejan Bosanac - http://twitter.com/dejanb
>>
>> Open Source Integration - http://fusesource.com/
>> ActiveMQ in Action - http://www.manning.com/snyder/
>> Blog - http://www.nighttale.net
>>
>>
>> On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
>> <ja...@gmail.com>wrote:
>>
>>> Hi All,
>>>
>>> It appears that the ActiveMQ FuseSource Stomp PHP client can't handle
>>> messages larger than 1024 bytes. The code is as follows in Stomp.php:
>>>
>>>        $rb = 1024;
>>>        $data = '';
>>>        $end = false;
>>>
>>>        do {
>>>            $read = fread($this->_socket, $rb);
>>>            if ($read === false) {
>>>                $this->_reconnect();
>>>                return $this->readFrame();
>>>            }
>>>            $data .= $read;
>>>            if (strpos($data, "\x00") !== false) {
>>>                $end = true;
>>>                $data = rtrim($data, "\n");
>>>            }
>>>            $len = strlen($data);
>>>        } while ($len < 2 || $end == false);
>>>
>>> If I set $rb to a larger value e.g. 1048576, it consumes the whole
>>> message and works as expected. What appears to be happening is that
>>> the first 1024 bytes are read, the loop exit condition is not met and
>>> then the client hangs on the $read = fread($this->_socket, $rb); line.
>>>
>>> I'm using:
>>>
>>> Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
>>> the irony is that by upgrading I save disk space... *sigh*)
>>> PHP 5.2.11
>>>
>>> Let me know if I should publish this to the fusesource dev mailing list
>>> instead
>>>
>>> cheers,
>>> j.
>>>
>>
>

Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Jamie McCrindle <ja...@gmail.com>.
Will post an issue. I'll see if I can submit a patch as well

cheers,
j.

ps: I've cross posted to stackoverflow to see if the php geniuses over
there have some ideas.

On Thu, Jan 14, 2010 at 11:26 AM, Dejan Bosanac <de...@nighttale.net> wrote:
> Hi Jamie,
>
> thanks for pointing to this issue. The best approach is to file a bug in
> project's Jira (http://fusesource.com/issues/browse/STOMP) and we'll take it
> from there (a patch that solves it would be even better).
>
> Cheers
> --
> Dejan Bosanac - http://twitter.com/dejanb
>
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
>
>
> On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
> <ja...@gmail.com>wrote:
>
>> Hi All,
>>
>> It appears that the ActiveMQ FuseSource Stomp PHP client can't handle
>> messages larger than 1024 bytes. The code is as follows in Stomp.php:
>>
>>        $rb = 1024;
>>        $data = '';
>>        $end = false;
>>
>>        do {
>>            $read = fread($this->_socket, $rb);
>>            if ($read === false) {
>>                $this->_reconnect();
>>                return $this->readFrame();
>>            }
>>            $data .= $read;
>>            if (strpos($data, "\x00") !== false) {
>>                $end = true;
>>                $data = rtrim($data, "\n");
>>            }
>>            $len = strlen($data);
>>        } while ($len < 2 || $end == false);
>>
>> If I set $rb to a larger value e.g. 1048576, it consumes the whole
>> message and works as expected. What appears to be happening is that
>> the first 1024 bytes are read, the loop exit condition is not met and
>> then the client hangs on the $read = fread($this->_socket, $rb); line.
>>
>> I'm using:
>>
>> Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
>> the irony is that by upgrading I save disk space... *sigh*)
>> PHP 5.2.11
>>
>> Let me know if I should publish this to the fusesource dev mailing list
>> instead
>>
>> cheers,
>> j.
>>
>

Re: ActiveMQ FuseSource Stomp large payloads problem

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi Jamie,

thanks for pointing to this issue. The best approach is to file a bug in
project's Jira (http://fusesource.com/issues/browse/STOMP) and we'll take it
from there (a patch that solves it would be even better).

Cheers
--
Dejan Bosanac - http://twitter.com/dejanb

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Thu, Jan 14, 2010 at 12:09 PM, Jamie McCrindle
<ja...@gmail.com>wrote:

> Hi All,
>
> It appears that the ActiveMQ FuseSource Stomp PHP client can't handle
> messages larger than 1024 bytes. The code is as follows in Stomp.php:
>
>        $rb = 1024;
>        $data = '';
>        $end = false;
>
>        do {
>            $read = fread($this->_socket, $rb);
>            if ($read === false) {
>                $this->_reconnect();
>                return $this->readFrame();
>            }
>            $data .= $read;
>            if (strpos($data, "\x00") !== false) {
>                $end = true;
>                $data = rtrim($data, "\n");
>            }
>            $len = strlen($data);
>        } while ($len < 2 || $end == false);
>
> If I set $rb to a larger value e.g. 1048576, it consumes the whole
> message and works as expected. What appears to be happening is that
> the first 1024 bytes are read, the loop exit condition is not met and
> then the client hangs on the $read = fread($this->_socket, $rb); line.
>
> I'm using:
>
> Mac OS X Leopard (yeah, I'll upgrade when I have more disk space...
> the irony is that by upgrading I save disk space... *sigh*)
> PHP 5.2.11
>
> Let me know if I should publish this to the fusesource dev mailing list
> instead
>
> cheers,
> j.
>