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

Cant get shrading to work #67

Open
vpaskovic opened this issue Jun 7, 2019 · 3 comments
Open

Cant get shrading to work #67

vpaskovic opened this issue Jun 7, 2019 · 3 comments
Labels

Comments

@vpaskovic
Copy link

vpaskovic commented Jun 7, 2019

I am having issue using sharding. I want to achieve having one queue that has 6 consumers but with sharding to achieve that each consumer is on one CPU.

After enabling
rabbitmq-plugins enable rabbitmq_sharding

and setting up config

'exchange'              => 'shard.videos',
'exchange_type'         => 'x-modulus-hash',

making policy
rabbitmqctl set_policy videos-shard "^shard.videos$" "{""shards-per-node"": 1,""routing-key"": ""fc_analyze""}"

with
\Amqp::publish('fc_analyze', 'this is message');

I get it to wright queue but can not get consumer in that queue using this code

\Amqp::consume('videos', function ($message, $resolver) {
         var_dump($message->body);
         sleep(20);
         $resolver->acknowledge($message);
      }, [
      	'message_limit' => 1,
        'exchange' => 'shard.videos',
        'exchange_type' => 'x-modulus-hash',
        'routing_key' => 'fc-analyze',
     ]
);

Please help and advice.
Thank you

@stevenklar
Copy link
Collaborator

stevenklar commented Oct 16, 2019

@vpaskovic The queue name is 'shard.videos' right? But you got 'videos' and 'shard.videos' mixed.

Just reopen this issue if it's still not working.

@vpaskovic
Copy link
Author

Hi @stevenklar when I put 'shard.videos' in \Amqp::consume('shard.videos', there is Error, as it does not accept queue name with dots.
So there is still a problem.

@stevenklar
Copy link
Collaborator

Right now I'm not sure if we support this. Must be tested.

/Reopen

@stevenklar stevenklar reopened this Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants