{"action":"created","issue":{"url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/11","labels_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/11/comments","events_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/11/events","html_url":"https://github.com/M6Web/AmqpBundle/issues/11","id":70434776,"number":11,"title":"Messages not published","user":{"login":"NiR-","id":557933,"avatar_url":"https://avatars.githubusercontent.com/u/557933?v=3","gravatar_id":"","url":"https://api.github.com/users/NiR-","html_url":"https://github.com/NiR-","followers_url":"https://api.github.com/users/NiR-/followers","following_url":"https://api.github.com/users/NiR-/following{/other_user}","gists_url":"https://api.github.com/users/NiR-/gists{/gist_id}","starred_url":"https://api.github.com/users/NiR-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NiR-/subscriptions","organizations_url":"https://api.github.com/users/NiR-/orgs","repos_url":"https://api.github.com/users/NiR-/repos","events_url":"https://api.github.com/users/NiR-/events{/privacy}","received_events_url":"https://api.github.com/users/NiR-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-23T15:02:27Z","updated_at":"2015-04-29T15:17:46Z","closed_at":null,"body":"Hi there, \r\n\r\nI am trying to use a producer which is bound to direct exchange, but I am facing two bugs :\r\n* With the `delivery_mode` parameter set to `persistent`, it seems that the exchange never receive the messages.\r\n* And when this option is not use, whether the queue has been manually created (`rabbitmqadmin declare exchange name='campaign_analysis' type='direct' && rabbitmqadmin declare queue name='campaign_analysis'`) or not, the first message is not published (but the following are correctly published). I've also tried with 'amq.direct' exchange, but I have the same behavior.\r\n\r\nHere is my current config :\r\n```yaml\r\nm6_web_amqp:\r\n    event_dispatcher: false\r\n    connections:\r\n        default:\r\n            host:     %amqp_host%\r\n            port:     %amqp_port%\r\n            timeout:  %amqp_timeout%\r\n            login:    %amqp_user%\r\n            password: %amqp_password%\r\n            vhost:    %amqp_vhost%\r\n            lazy:     false\r\n    producers:\r\n        campaign_analysis:\r\n            connection: default\r\n            exchange_options:\r\n                name: 'campaign_analysis'\r\n                type: direct\r\n                routing_keys: ['campaign_analysis']\r\n                publish_attributes:\r\n                    content_type: 'application/json'\r\n                    #delivery_mode: 'persistent'\r\n    consumers:\r\n        campaign_analysis:\r\n            connection: default\r\n            exchange_options:\r\n                name: 'campaign_analysis'\r\n            queue_options:\r\n                name: 'campaign_analysis'\r\n                durable: true\r\n                routing_keys: ['campaign_analysis']\r\n```\r\n\r\nAny help would be appreciated :)\r\n\r\nEDIT: I have tried this simple POC and it seems to work fine :\r\n```php\r\n<?php\r\n\r\n$conn = new AMQPConnection();\r\n$conn->setHost('localhost');\r\n$conn->setPort(5672);\r\n$conn->setLogin('guest');\r\n$conn->setPassword('guest');\r\n$conn->setVhost('/');\r\n$conn->connect();\r\n\r\n$ch = new AMQPChannel($conn);\r\n\r\n$ex = new AMQPExchange($ch);\r\n$ex->setName('amq.direct');\r\n$ex->setType(AMQP_EX_TYPE_DIRECT);\r\n$ex->setFlags(AMQP_DURABLE);\r\n$ex->declare();\r\n\r\n$q = new AMQPQueue($ch);\r\n$q->setName('campaign_analysis');\r\n$q->declare();\r\n$q->bind('amq.direct', 'campaign_analysis');\r\n\r\n$ex->publish('Hi there!', 'campaign_analysis');\r\n\r\n// var_dump($q->get(AMQP_AUTOACK));\r\n```"},"comment":{"url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/comments/97463902","html_url":"https://github.com/M6Web/AmqpBundle/issues/11#issuecomment-97463902","issue_url":"https://api.github.com/repos/M6Web/AmqpBundle/issues/11","id":97463902,"user":{"login":"fabdsp","id":5878620,"avatar_url":"https://avatars.githubusercontent.com/u/5878620?v=3","gravatar_id":"","url":"https://api.github.com/users/fabdsp","html_url":"https://github.com/fabdsp","followers_url":"https://api.github.com/users/fabdsp/followers","following_url":"https://api.github.com/users/fabdsp/following{/other_user}","gists_url":"https://api.github.com/users/fabdsp/gists{/gist_id}","starred_url":"https://api.github.com/users/fabdsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabdsp/subscriptions","organizations_url":"https://api.github.com/users/fabdsp/orgs","repos_url":"https://api.github.com/users/fabdsp/repos","events_url":"https://api.github.com/users/fabdsp/events{/privacy}","received_events_url":"https://api.github.com/users/fabdsp/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T15:17:46Z","updated_at":"2015-04-29T15:17:46Z","body":"Hello,\r\n\r\nThere is no queue configuration at the producer level, only at the consumer level: the producer only need to know the routing keys to send a message to an exchange and many consumers can create many queues, listening to many routing keys: ideally, the producer should not be responsible for creating the queues, only the consumers must - you don't know in advance what the consumers will do with these messages, do you ?\r\n\r\nBut you're right :  if no queue exists for the routing keys, the message is lost. So feel free to add an optional queue configuration for the producer (to create a queue at producer level for example) ! We will be happy to add this feature.\r\n\r\nThank you again,"}}