GithubHelp home page GithubHelp logo

mookofe / tail Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 21.0 41 KB

RabbitMQ and PHP client for Laravel that allows you to add and listen queues messages just simple.

License: MIT License

PHP 100.00%

tail's People

Contributors

m4rcdev avatar martinhilscher avatar mookofe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tail's Issues

Not working with Exchange type "fan-out"

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))

Not possible to change exchange type

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

Package videlalvaro/php-amqplib is abandoned, you should avoid using it. Use php-amqplib/php-amqplib instead.

Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Installing videlalvaro/php-amqplib (v2.6.2)
    Downloading: 100%
  • Installing mookofe/tail (v1.0.3)
    Downloading: 100%

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.

1.0.6

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 support

Lumen is not supported because of the the slightly different ServiceProvider.

Broken pipe or closed connection

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)

Tail class can not be found

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?

Message not delivered to queue when exchange is declared

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);

Durable

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

config

`
'ssl_context_options' => null,
'connection_timeout' => 3.0,
'read_write_timeout' => 3.0,
'keepalive' => false,

Option [ssl_context_options] is not valid in file
`

inequivalent arg 'internal' for exchange 'amq.rabbitmq.log' in vhost '/': received 'false' but current is 'true

( 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.