{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/tactician-bernard/issues/29","labels_url":"https://api.github.com/repos/thephpleague/tactician-bernard/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/tactician-bernard/issues/29/comments","events_url":"https://api.github.com/repos/thephpleague/tactician-bernard/issues/29/events","html_url":"https://github.com/thephpleague/tactician-bernard/issues/29","id":111661017,"number":29,"title":"Consumer not receiving any commands","user":{"login":"varakh","id":4570674,"avatar_url":"https://avatars.githubusercontent.com/u/4570674?v=3","gravatar_id":"","url":"https://api.github.com/users/varakh","html_url":"https://github.com/varakh","followers_url":"https://api.github.com/users/varakh/followers","following_url":"https://api.github.com/users/varakh/following{/other_user}","gists_url":"https://api.github.com/users/varakh/gists{/gist_id}","starred_url":"https://api.github.com/users/varakh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varakh/subscriptions","organizations_url":"https://api.github.com/users/varakh/orgs","repos_url":"https://api.github.com/users/varakh/repos","events_url":"https://api.github.com/users/varakh/events{/privacy}","received_events_url":"https://api.github.com/users/varakh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-15T16:55:57Z","updated_at":"2015-10-17T13:41:24Z","closed_at":null,"body":"Hi there,\r\n\r\nthanks for your package in advance, sounds really great and I have tried to get it working, but I really have no clue hat I am doing wrong here.\r\n\r\nI hope you can give a hint here:\r\n\r\n```\r\n$inflector = new HandleClassNameInflector();\r\n$locator = new InMemoryLocator();\r\n$locator->addHandler(new TestCommandHandler(), TestCommand::class);\r\n$nameExtractor = new ClassNameExtractor();\r\n$commandHandlerMiddleware = new CommandHandlerMiddleware($nameExtractor, $locator, $inflector);\r\n\r\n$factory = new InMemoryFactory();\r\n$factory->create('commandbus');\r\n$producer = new Producer($factory, new EventDispatcher());\r\n$queueMiddleware = new QueueMiddleware($producer);\r\n\r\n$commandBus = new CommandBus([$queueMiddleware]);\r\n//$commandBus = new CommandBus([$commandHandlerMiddleware]);\r\n$commandBus->handle(new TestCommand());\r\n```\r\n\r\nThis works like a charm when using CommandHandlerMiddleware, but I need external with QueueMiddleware. I am calling the following with php mypath/commandserver and it starts but never receives any commands added:\r\n\r\n```\r\n$factory = new InMemoryFactory();\r\n$producer = new Producer($factory, new EventDispatcher());\r\n$queueMiddleware = new QueueMiddleware($producer);\r\n\r\n$commandBus = new CommandBus([$queueMiddleware]);\r\n$receiver = new League\\Tactician\\Bernard\\Receiver\\SeparateBusReceiver($commandBus);\r\n\r\n$router = new \\Bernard\\Router\\SimpleRouter([$receiver]);\r\n$router->add('League\\Tactician\\Bernard\\QueueableCommand', $receiver);\r\n\r\n$consumer = new \\Bernard\\Consumer($router, new \\Symfony\\Component\\EventDispatcher\\EventDispatcher());\r\n$queue = $factory->create('commandbus');\r\n$consumer->consume($queue);\r\n```\r\n\r\nI tried to debug this adding `if ($queue->count() > 0) echo \"Received a command.\" . \"\\n\";` to the consume method in Consumer.php. \r\n\r\nThe queue is always empty."},"comment":{"url":"https://api.github.com/repos/thephpleague/tactician-bernard/issues/comments/148916884","html_url":"https://github.com/thephpleague/tactician-bernard/issues/29#issuecomment-148916884","issue_url":"https://api.github.com/repos/thephpleague/tactician-bernard/issues/29","id":148916884,"user":{"login":"varakh","id":4570674,"avatar_url":"https://avatars.githubusercontent.com/u/4570674?v=3","gravatar_id":"","url":"https://api.github.com/users/varakh","html_url":"https://github.com/varakh","followers_url":"https://api.github.com/users/varakh/followers","following_url":"https://api.github.com/users/varakh/following{/other_user}","gists_url":"https://api.github.com/users/varakh/gists{/gist_id}","starred_url":"https://api.github.com/users/varakh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varakh/subscriptions","organizations_url":"https://api.github.com/users/varakh/orgs","repos_url":"https://api.github.com/users/varakh/repos","events_url":"https://api.github.com/users/varakh/events{/privacy}","received_events_url":"https://api.github.com/users/varakh/received_events","type":"User","site_admin":false},"created_at":"2015-10-17T13:41:24Z","updated_at":"2015-10-17T13:41:24Z","body":"That's not defined in the same script. It's defined in two different scripts. \"External\" means 2 scripts, sorry.\r\n\r\nGot the things I need working with the scheduler-plugin of tactician, but I am stil curious about getting it to work with bernard."}}