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

subscribers cannot receive all message from topic #29

Open
jiansongjay opened this issue Aug 15, 2014 · 0 comments
Open

subscribers cannot receive all message from topic #29

jiansongjay opened this issue Aug 15, 2014 · 0 comments

Comments

@jiansongjay
Copy link

My stomp version is 1.0.0. ActiveMq version is 5.10.0. When I use topic model of stomp to publish and subscribe, I found that subscriber cannot receive all message from topic when the number of message over 5000. My code is shown below.

send.php
require_once("Stomp.php");
$con = new Stomp("tcp://localhost:61613");
$con->connect();
$count = 0;
for ($i = 0; $i < 5000; $i++)
{
$ret = $con->send("/topic/test_mq", "test$i");
if ($ret === true)
{
++$count;
}
}
echo 'send msg:' . $count . "\n";
$con->disconnect();

receive.php
require_once("Stomp.php");
$con = new Stomp("tcp://localhost:61613");
$con->connect();

$con->subscribe("/topic/test_mq");
$count = 0;
while (true)
{
$msg = $con->readFrame();
if ( $msg != null) {
$count++;
echo "Received message with body '$msg->body':$count\n";
$con->ack($msg);
} else {
echo "Failed to receive a message\n";
}
}
$con->disconnect();

Firstly, I start receive.php. Then I run the send.php. But the receive.php cannot get all the messages. It usually get over 4000, lost the rest of them.
Is it a bug?

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

No branches or pull requests

1 participant