mookofe / tail Goto Github PK
View Code? Open in Web Editor NEWRabbitMQ and PHP client for Laravel that allows you to add and listen queues messages just simple.
License: MIT License
RabbitMQ and PHP client for Laravel that allows you to add and listen queues messages just simple.
License: MIT License
The type of my exchange is fan-out. I'm getting error as
exception 'PhpAmqpLib\Exception\AMQPProtocolChannelException' with message 'PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'email-in' in vhost '/': received 'direct' but current is 'fanout'' in C:\wamp64\www\spiraldesk_api\v1\vendor\php-amqplib\php-amqplib\PhpAmqpLib\Channel\AMQPChannel.php:188
Stack trace:0 [internal function]: PhpAmqpLib\Channel\AMQPChannel->channel_close(Object(PhpAmqpLib\Wire\AMQPReader))
1 C:\wamp64\www\spiraldesk_api\v1\vendor\php-amqplib\php-amqplib\PhpAmqpLib\Channel\AbstractChannel.php(199): call_user_func(Array, Object(PhpAmqpLib\Wire\AMQPReader))
Hi,
According to the documentation, the exchange type should be possible to change, but when added in the array of configuration ('exchange_type' => 'topic'), I get this error:
[Mookofe\Tail\Exceptions\InvalidOptionException]
Option [exchange_type] is not valid
Also, according to the code in Connection.php , which is:
$this->AMQPConnection = new AMQPConnection($this->host, $this->port, $this->username, $this->password, $this->vhost);
$this->channel = $this->AMQPConnection->channel();
$this->channel->queue_declare($this->queue_name, false, true, false, false);
$this->channel->exchange_declare($this->exchange, 'direct', false, true, false);
$this->channel->queue_bind($this->queue_name, $this->exchange);
The exchange type is hardcoded always in 'direct' and the durable and other parameters are not changeable.
Thanks,
Jaume
Not sure if connected to this plugin or upstream, but will post here too for reference since this plugin is part of the process.
Loading composer repositories with package information
Updating dependencies (including require-dev)
videlalvaro/php-amqplib suggests installing ext-sockets (Use AMQPSocketConnection)
Package videlalvaro/php-amqplib is abandoned, you should avoid using it. Use php-amqplib/php-amqplib instead.
Can you please do a new release on pagackist? There is some bug that was fixed in a111072 that is causing build to fail and I prefer not to use dev-master. Thanks!
Lumen is not supported because of the the slightly different ServiceProvider.
code:
Tail::listen($queue, function($message) use ($callbackClass, $callbackFunc) {
call_user_func([$callbackClass, $callbackFunc], $message);
});
exception:
Broken pipe or closed connection {"exception":"[object] (PhpAmqpLib\Exception\AMQPRuntimeException(code: 0): Broken pipe or closed connection at /srv/deploy/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php:214)
Hi,
I'm using Lumen 5.2 and I've already done what you say to integrate it.
In my controller I use it like this :
Tail::add('test', 'message');
it gives me this error :
Fatal error: Class 'App\Http\Controllers\Tail' not found
$app->withFacades(); is active in app.php
What should I do?
I have been trying to use the library, but whenever i try declaring an exchange, the exchange gets declared, so does the queue, but the message isn't delivered to the queue.
Here's my code
$options = array (
'exchange' => 'user_exchange'
);
Tail::add('user_queue', $user, $options);
In case you want to push a message to multiple queues (because different clients have an interest of them) you need to create a queue which is bind to a defined routing key.
https://www.rabbitmq.com/e2e.html
The 3rd parameter of the queue_bind method defines the routing key.
https://github.com/mookofe/tail/blob/master/src/Connection.php#L94
Just allow to set a routing key by option.
Hello how i can overwrite the durability setting? because when i want to consume a message i got this kind of message
[Exception] PhpAmqpLib\Exception\AMQPProtocolChannelException: PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'exchnge_name' in vhost '/': received 'true' but current is 'false' in \vendor\php-amqplib\php-amqplib\PhpAmqpLib\Channel\AMQPChannel.php:188
`
'ssl_context_options' => null,
'connection_timeout' => 3.0,
'read_write_timeout' => 3.0,
'keepalive' => false,
Option [ssl_context_options] is not valid in file
`
Hello!
Please look at https://github.com/queue-interop/queue-interop project. Using interfaces from it allows us reuse some implementations like enqueue, which supports a lot of transports. You can outsource some code
Hello guys, how do I start the consumers!?!?!
Add new message OK, but I can't process that message in queue.
https://github.com/mookofe/tail/blob/master/src/Message.php#L73
$this->exchange is null unless you define it by option in the call. Why not using the default exchange from the default configuration file (tail-settings.php)?
see #18
hi try use AMQP but when made use callback this error-> FatalThrowableError in AMQPWriter.php line 274: Call to undefined function PhpAmqpLib\Wire\bcadd()
i used laravel 5.2
( in laravel 5 )
..............................................................................
$options = array(
'message_limit' => 50,
'time' => 60,
'empty_queue_timeout' => 5,
'message_limit' => 50,
'exchange' => 'amq.rabbitmq.log',
'exchange_type' => 'topic',
);
Tail::listenWithOptions('', $options, function($message) {
var_dump($message);
});
.................................................................................
get wrong exception 'PhpAmqpLib\Exception\AMQPProtocolChannelException' with message 'PRECONDITION_FAILED - inequivalent arg 'internal' for exchange 'amq.rabbitmq.log' in vhost '/': received 'false' but current is 'true'' in F:\wamp64\www\monitor\vendor\php-amqplib\php-amqplib\PhpAmqpLib\Channel\AMQPChannel.php:188
please help me ,thank you
I got an ERROR use Tail. Here is my code:
Tail::add('ConsoleNotice', $notice);
I trace this error and find out when close connections it produce an error. Here is the close connections code: code
public function close()
{
if (isset($this->AMQPConnection))
$this->AMQPConnection->close();
if (isset($this->channel))
$this->channel->close();
}
Same ISSUE see php-amqplib/php-amqplib#116
Working with GLOBALS will not work when using multiple listeners in one thread.
https://github.com/mookofe/tail/blob/master/src/Listener.php#L72
Better approach would be to store these information in the class instance or at least use a unique key as separator in the GLOBALS.
I have to perform some specific task after some specific time. I need to use x-delay option in rabbitmq to send message after x seconds. Is it possible to achieve it using this library ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.