пример
на Perl
чуть подредактировать, убрав все "$ch->consume...", вызывать publish в цикле.
нашел на пыхе используется
php-amqp:
<?php
$connection = new AMQPConnection(['host'=> '127.0.0.1', 'port' => '5672', 'login' => '', 'password' => '', 'vhost' => 'ejebberd', 'connect_timeout' => 10]);
$connection->connect();
$channel = new AMQPChannel($connection);
$exchangename = IPhonParameters::$rabbit_EXCHANGE;
$queue = 'ejabberd';
$routing_key = 'ejabberd';
$exchange = new AMQPExchange($channel);
$exchange->setName($exchangename);
$exchange->setType(AMQP_EX_TYPE_DIRECT);
$exchange->setFlags(AMQP_DURABLE);
$exchange->declareExchange();
$q = new AMQPQueue($channel);
$q->setName($queue);
$q->setFlags(AMQP_DURABLE);
$q->declareQueue();
$q->bind($exchangename, $routing_key);
for ($i = 1001; $i < 3001 ; $i++) {
$aaa = sprintf('%04d', $i);
$a_body = [
'server' => 'default'
, 'domain' => 'test.com'
, 'action' => 'add'
, 'login' => 'test'.$aaa
, 'password' => 'test'.$aaa
];
$msg_body = json_encode($a_body, JSON_UNESCAPED_UNICODE);
$exchange->publish($msg_body, $routing_key, AMQP_NOPARAM, ['content_type' => 'text/javascript', 'delivery_mode' => 2]);
}
$connection->disconnect();
?>