Skip to content

subscribers cannot receive all message from topic #29

@jiansongjay

Description

@jiansongjay

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions