You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by is...@centrum.cz on 2012/04/23 14:13:57 UTC

Apollo and perl client - unable to dequeue all messages from queue

Hi all,

I'm looking for a messaging engine which can be able to work with application written in perl. So, I installed Apollo 1.2 on my linux box and I wrote the first test script using Net::STOMP::Client module. But I encounter a problem. I enqueued 10000 persistent messages and I tried to dequeue them. It works ok if the perl script dequeue all 10000 messages. But if the script dequeue  100 messages only (example) and finishes,  after a few runs the server stops to serve messages. I looks like the queue is empty. Through GUI administration I can see that there are messages in the queue, but perl script is unable to retrieve them - wait_for_frames() timeouted. If I restart Apollo server, I can continue retrieving messages until the server is stuck again. I downloaded the latest Apollo snapshot and nothing changed. I also changed the default store engine to DBD store. The same. I even changed JVM engine from my default OpenJDK 64-Bit Server VM 1.6.0_23 (Sun Microsystems Inc.)'' to th
 e latest 'Java HotSpot(TM) 64-Bit Server VM 1.7.0_03 (Oracle Corporation)'. No change.  When the Apollo server is "blocked" and client is unable to retrieve messages, I can enqueue another messages from other producer and client receives these messages. But the original ones are blocked until I restart server. There is no warning or error message on Apollo console.

Because this is my first atempt to work with STOMP I'm not sure if the problem is not on my side but currently I have no idea what is wrong. 

The test script is here:
http://gist.github.com/5ef9113f6b6aec81bca9

perl <script.pl> produce    ....enqueues 10000 messages
perl <script.pl> consume 10000  ... dequeues 10000 messages

but

perl <script.pl> produce    ....enqueues 10000 messages
for i in seq `1 100`; do perl <script.pl> consume 100; done   .... is blocked after a few runs (looks random count)


Thanks for any help.

Ivan

Re: Apollo and perl client - unable to dequeue all messages from queue

Posted by ISim <IS...@centrum.cz>.
Hi Hiram,

I downloaded the snapshot and tested it again. It works as I expected.
Thank you very much for this quick patch.

Best regards,
Ivan

On Thu, Apr 26, 2012 at 6:49 PM, Hiram Chirino <hi...@hiramchirino.com>wrote:

> Hi Ivan,
>
> This should now be fixed in the following snapshot build:
>
>
> https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-apollo/99-trunk-SNAPSHOT/apache-apollo-99-trunk-20120426.164540-25-unix-distro.tar.gz
>
>
> On Thu, Apr 26, 2012 at 8:02 AM, Hiram Chirino <hiram@hiramchirino.com
> >wrote:
>
> > Hi Ivan,
> >
> > Thanks for the bug report!  I've been able to reproduce using your test
> > case, It looks like messages are being 'released' when the consumer
> > disconnects and then don't subsequently get delivered.  I'll look into
> > fixing this asap.
> >
> >
> > On Mon, Apr 23, 2012 at 8:13 AM, <is...@centrum.cz> wrote:
> >
> >>
> >> Hi all,
> >>
> >> I'm looking for a messaging engine which can be able to work with
> >> application written in perl. So, I installed Apollo 1.2 on my linux box
> and
> >> I wrote the first test script using Net::STOMP::Client module. But I
> >> encounter a problem. I enqueued 10000 persistent messages and I tried to
> >> dequeue them. It works ok if the perl script dequeue all 10000 messages.
> >> But if the script dequeue  100 messages only (example) and finishes,
>  after
> >> a few runs the server stops to serve messages. I looks like the queue is
> >> empty. Through GUI administration I can see that there are messages in
> the
> >> queue, but perl script is unable to retrieve them - wait_for_frames()
> >> timeouted. If I restart Apollo server, I can continue retrieving
> messages
> >> until the server is stuck again. I downloaded the latest Apollo snapshot
> >> and nothing changed. I also changed the default store engine to DBD
> store.
> >> The same. I even changed JVM engine from my default OpenJDK 64-Bit
> Server
> >> VM 1.6.0_23 (Sun Microsystems Inc.)'' to th
> >>  e latest 'Java HotSpot(TM) 64-Bit Server VM 1.7.0_03 (Oracle
> >> Corporation)'. No change.  When the Apollo server is "blocked" and
> client
> >> is unable to retrieve messages, I can enqueue another messages from
> other
> >> producer and client receives these messages. But the original ones are
> >> blocked until I restart server. There is no warning or error message on
> >> Apollo console.
> >>
> >> Because this is my first atempt to work with STOMP I'm not sure if the
> >> problem is not on my side but currently I have no idea what is wrong.
> >>
> >> The test script is here:
> >> http://gist.github.com/5ef9113f6b6aec81bca9
> >>
> >> perl <script.pl> produce    ....enqueues 10000 messages
> >> perl <script.pl> consume 10000  ... dequeues 10000 messages
> >>
> >> but
> >>
> >> perl <script.pl> produce    ....enqueues 10000 messages
> >> for i in seq `1 100`; do perl <script.pl> consume 100; done   .... is
> >> blocked after a few runs (looks random count)
> >>
> >>
> >> Thanks for any help.
> >>
> >> Ivan
> >>
> >
> >
> >
> > --
> >
> > **
> >
> > *Hiram Chirino*
> >
> > *Software Fellow | FuseSource Corp.*
> >
> > *chirino@fusesource.com | fusesource.com*
> >
> > *skype: hiramchirino | twitter: @hiramchirino<
> http://twitter.com/hiramchirino>
> > *
> >
> > *blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>*
> >
> > *
> > *
> >
> > *
> > *
> >
> >
> >
>
>
> --
>
> **
>
> *Hiram Chirino*
>
> *Software Fellow | FuseSource Corp.*
>
> *chirino@fusesource.com | fusesource.com*
>
> *skype: hiramchirino | twitter: @hiramchirino<
> http://twitter.com/hiramchirino>
> *
>
> *blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>*
>
> *
> *
>
> *
> *
>

Re: Apollo and perl client - unable to dequeue all messages from queue

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi Ivan,

This should now be fixed in the following snapshot build:

https://repository.apache.org/content/repositories/snapshots/org/apache/activemq/apache-apollo/99-trunk-SNAPSHOT/apache-apollo-99-trunk-20120426.164540-25-unix-distro.tar.gz


On Thu, Apr 26, 2012 at 8:02 AM, Hiram Chirino <hi...@hiramchirino.com>wrote:

> Hi Ivan,
>
> Thanks for the bug report!  I've been able to reproduce using your test
> case, It looks like messages are being 'released' when the consumer
> disconnects and then don't subsequently get delivered.  I'll look into
> fixing this asap.
>
>
> On Mon, Apr 23, 2012 at 8:13 AM, <is...@centrum.cz> wrote:
>
>>
>> Hi all,
>>
>> I'm looking for a messaging engine which can be able to work with
>> application written in perl. So, I installed Apollo 1.2 on my linux box and
>> I wrote the first test script using Net::STOMP::Client module. But I
>> encounter a problem. I enqueued 10000 persistent messages and I tried to
>> dequeue them. It works ok if the perl script dequeue all 10000 messages.
>> But if the script dequeue  100 messages only (example) and finishes,  after
>> a few runs the server stops to serve messages. I looks like the queue is
>> empty. Through GUI administration I can see that there are messages in the
>> queue, but perl script is unable to retrieve them - wait_for_frames()
>> timeouted. If I restart Apollo server, I can continue retrieving messages
>> until the server is stuck again. I downloaded the latest Apollo snapshot
>> and nothing changed. I also changed the default store engine to DBD store.
>> The same. I even changed JVM engine from my default OpenJDK 64-Bit Server
>> VM 1.6.0_23 (Sun Microsystems Inc.)'' to th
>>  e latest 'Java HotSpot(TM) 64-Bit Server VM 1.7.0_03 (Oracle
>> Corporation)'. No change.  When the Apollo server is "blocked" and client
>> is unable to retrieve messages, I can enqueue another messages from other
>> producer and client receives these messages. But the original ones are
>> blocked until I restart server. There is no warning or error message on
>> Apollo console.
>>
>> Because this is my first atempt to work with STOMP I'm not sure if the
>> problem is not on my side but currently I have no idea what is wrong.
>>
>> The test script is here:
>> http://gist.github.com/5ef9113f6b6aec81bca9
>>
>> perl <script.pl> produce    ....enqueues 10000 messages
>> perl <script.pl> consume 10000  ... dequeues 10000 messages
>>
>> but
>>
>> perl <script.pl> produce    ....enqueues 10000 messages
>> for i in seq `1 100`; do perl <script.pl> consume 100; done   .... is
>> blocked after a few runs (looks random count)
>>
>>
>> Thanks for any help.
>>
>> Ivan
>>
>
>
>
> --
>
> **
>
> *Hiram Chirino*
>
> *Software Fellow | FuseSource Corp.*
>
> *chirino@fusesource.com | fusesource.com*
>
> *skype: hiramchirino | twitter: @hiramchirino<http://twitter.com/hiramchirino>
> *
>
> *blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>*
>
> *
> *
>
> *
> *
>
>
>


-- 

**

*Hiram Chirino*

*Software Fellow | FuseSource Corp.*

*chirino@fusesource.com | fusesource.com*

*skype: hiramchirino | twitter: @hiramchirino<http://twitter.com/hiramchirino>
*

*blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>*

*
*

*
*

Re: Apollo and perl client - unable to dequeue all messages from queue

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Hi Ivan,

Thanks for the bug report!  I've been able to reproduce using your test
case, It looks like messages are being 'released' when the consumer
disconnects and then don't subsequently get delivered.  I'll look into
fixing this asap.

On Mon, Apr 23, 2012 at 8:13 AM, <is...@centrum.cz> wrote:

>
> Hi all,
>
> I'm looking for a messaging engine which can be able to work with
> application written in perl. So, I installed Apollo 1.2 on my linux box and
> I wrote the first test script using Net::STOMP::Client module. But I
> encounter a problem. I enqueued 10000 persistent messages and I tried to
> dequeue them. It works ok if the perl script dequeue all 10000 messages.
> But if the script dequeue  100 messages only (example) and finishes,  after
> a few runs the server stops to serve messages. I looks like the queue is
> empty. Through GUI administration I can see that there are messages in the
> queue, but perl script is unable to retrieve them - wait_for_frames()
> timeouted. If I restart Apollo server, I can continue retrieving messages
> until the server is stuck again. I downloaded the latest Apollo snapshot
> and nothing changed. I also changed the default store engine to DBD store.
> The same. I even changed JVM engine from my default OpenJDK 64-Bit Server
> VM 1.6.0_23 (Sun Microsystems Inc.)'' to th
>  e latest 'Java HotSpot(TM) 64-Bit Server VM 1.7.0_03 (Oracle
> Corporation)'. No change.  When the Apollo server is "blocked" and client
> is unable to retrieve messages, I can enqueue another messages from other
> producer and client receives these messages. But the original ones are
> blocked until I restart server. There is no warning or error message on
> Apollo console.
>
> Because this is my first atempt to work with STOMP I'm not sure if the
> problem is not on my side but currently I have no idea what is wrong.
>
> The test script is here:
> http://gist.github.com/5ef9113f6b6aec81bca9
>
> perl <script.pl> produce    ....enqueues 10000 messages
> perl <script.pl> consume 10000  ... dequeues 10000 messages
>
> but
>
> perl <script.pl> produce    ....enqueues 10000 messages
> for i in seq `1 100`; do perl <script.pl> consume 100; done   .... is
> blocked after a few runs (looks random count)
>
>
> Thanks for any help.
>
> Ivan
>



-- 

**

*Hiram Chirino*

*Software Fellow | FuseSource Corp.*

*chirino@fusesource.com | fusesource.com*

*skype: hiramchirino | twitter: @hiramchirino<http://twitter.com/hiramchirino>
*

*blog: Hiram Chirino's Bit Mojo <http://hiramchirino.com/blog/>*

*
*

*
*

Re: Apollo and perl client - unable to dequeue all messages from queue

Posted by Lionel Cons <li...@cern.ch>.
<is...@centrum.cz> writes:
> Because this is my first atempt to work with STOMP I'm not sure if the
> problem is not on my side but currently I have no idea what is wrong.

I could reproduce the problem using a recent Apollo snapshot. This looks
like an Apollo bug to me.

> The test script is here:
> http://gist.github.com/5ef9113f6b6aec81bca9

Using your script, Apollo indeed keeps for itself messages in the queue
that should be sent. To be noted: the messages are delivered
sequentially for some time and then there is a gap:

$ perl gistfile1.perl produce
(now there are 10k messages in the queue, confirmed by the console)

$ perl gistfile1.perl consume
Received: 1: Hello world! Tue Apr 24 08:07:28 2012 at gistfile1.perl line 68.
[...]
Received: 100: Hello world! Tue Apr 24 08:07:28 2012 at gistfile1.perl line 68.
Consumed: 100 at gistfile1.perl line 19.
(so far so good, first 100 message received)

$ perl gistfile1.perl consume
Received: 101: Hello world! Tue Apr 24 08:07:28 2012 at gistfile1.perl line 68.
[...]
Received: 200: Hello world! Tue Apr 24 08:07:28 2012 at gistfile1.perl line 68.
Consumed: 100 at gistfile1.perl line 19.
(idem)

...

$ perl gistfile1.perl consume
Received: 901: Hello world! Tue Apr 24 08:07:29 2012 at gistfile1.perl line 68.
Received: 902: Hello world! Tue Apr 24 08:07:29 2012 at gistfile1.perl line 68.
Received: 903: Hello world! Tue Apr 24 08:07:29 2012 at gistfile1.perl line 68.
[...]
Received: 984: Hello world! Tue Apr 24 08:07:29 2012 at gistfile1.perl line 68.
Received: 985: Hello world! Tue Apr 24 08:07:29 2012 at gistfile1.perl line 68.
Received: 986: Hello world! Tue Apr 24 08:07:29 2012 at gistfile1.perl line 68.
Received: 3620: Hello world! Tue Apr 24 08:07:30 2012 at gistfile1.perl line 68.
Received: 3621: Hello world! Tue Apr 24 08:07:30 2012 at gistfile1.perl line 68.
Received: 3622: Hello world! Tue Apr 24 08:07:30 2012 at gistfile1.perl line 68.
[...]
Received: 3633: Hello world! Tue Apr 24 08:07:30 2012 at gistfile1.perl line 68.
Consumed: 100 at gistfile1.perl line 19.
(messages 987 to 3619 have not been sent!)

Cheers,

Lionel