Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic_consume() throws an exception after 5 secs. #15

Open
GoogleCodeExporter opened this issue Mar 28, 2015 · 5 comments
Open

basic_consume() throws an exception after 5 secs. #15

GoogleCodeExporter opened this issue Mar 28, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Run the demo amqp_consumer.php
2. Wait 5 seconds.
3. The program crashes.

What is the expected output? What do you see instead?
I expect the consumer to idle indefinitely and output the data from the
message queue should amqp_publisher send something.
Intead I get the following error after 5 seconds:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Error
reading data. Recevived 0 instead of expected 1 bytes' in
/usr/share/php/amqp_wire.inc:316
Stack trace:
#0 /usr/share/php/amqp_wire.inc(347): AMQPReader->rawread(1)
#1 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(493):
AMQPReader->read_octet()
#2 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(513):
AMQPConnection->wait_frame()
#3 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(166):
AMQPConnection->wait_channel(1)
#4 /share/userdir/daharon/php-amqplib-read-only/amqp.inc(250):
AbstractChannel->next_frame()
#5 /share/userdir/daharon/php-amqplib-read-only/demo/amqp_consumer.php(48):
AbstractChannel->wait()
#6 {main}
  thrown in /usr/share/php/amqp_wire.inc on line 316

What version of the product are you using? On what operating system?
SVN downloaded on 4-23-2010

Please provide any additional information below.
If I quickly run the amqp_producer, the consumer will successfully get the
messages and output them.
It only fails if the producer hasn't sent anything for 5 seconds.

Original issue reported on code.google.com by [email protected] on 28 Apr 2010 at 7:08

@GoogleCodeExporter
Copy link
Author

On what operating system?
Fedora 10, Linux 2.6.27.41-170.2.117.fc10.x86_64, PHP 5.2.9, RabbitMQ 1.7.0

Original comment by [email protected] on 28 Apr 2010 at 7:12

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

What version of the product are you using?
Revision 25

Original comment by [email protected] on 28 Apr 2010 at 7:17

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Increasing the value of read_write_timeout for the AMQPConnection constructor 
allows
the consumer to keep alive longer.  But does not seem to fix the root problem
(whatever it is, not sure).

Original comment by [email protected] on 28 Apr 2010 at 9:11

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

On further inspection, it looks like it's mainly the buffer_read_timeout in
AMQPReader that is making AMQPReader->rawread() fail.

I'm not sure what to do here.  I really want to use the basic_consume 
functionality,
but it feels kind of wrong to stick the wait() function in a try block and just 
keep
ignoring exceptions.

Original comment by [email protected] on 28 Apr 2010 at 10:38

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

This issue/patch solved the problem.  He just removed the buffer_read_timeout 
check.
http://code.google.com/p/php-amqplib/issues/detail?id=12&can=1

Original comment by [email protected] on 28 Apr 2010 at 11:50

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant