[rabbitmq-discuss] Exchanges: Publish In/Out difference?

ku3ia demesg at gmail.com
Tue Aug 6 16:43:50 BST 2013


Hi all! I'm newbie at rabbitmq, please advice.
I'm using direct exchange (amq.direct). I'd bind a queue to it through
management plugin with specific route key. So my route is:
producer -> direct exchange -> queue via route key -> consumer

I'm using .net client to publish messages. my code is simple, something like
this: 

// main program... 
      var factory = new ConnectionFactory { HostName = "localhost" }; 
      IConnection _connection = factory.CreateConnection(); 
      IModel _model = _connection.CreateModel(); 
      IBasicProperties _basicProperties = _model.CreateBasicProperties(); 
      _basicProperties.DeliveryMode = 2; 
      _basicProperties.SetPersistent(true); 
      _model.ConfirmSelect(); 
      _model.BasicAcks += BasicAcks; 
      _model.BasicNacks += BasicNacks; 
      
      _model.BasicPublish("amq.direct", _routingKey, _basicProperties,
message); 
      
      if(_connection != null) 
        _connection.Close(); 
      if(_model != null) 
        _model.Close(); 

... 

    public void BasicAcks(IModel sender, BasicAckEventArgs args) 
    { 
      MessageBox.Show("Acks"); 
    } 

    public void BasicNacks(IModel sender, BasicNackEventArgs args) 
    { 
      MessageBox.Show("Nacks"); 
    } 

When I publish message I see at management GUI that message already
published. It is OK. Also I have a message box with "Acks" message. It is OK
too. After that I'm removing my queue which has binded to exchange and run
program again. I haven't any error and "acks" message appeared again.

As I understand producer knows that message has been published ("acks"
message) but seems it is no correct, because it is not routed to destination
queue.

Can I catch this in .net client? Thanks




--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/Exchanges-Publish-In-Out-difference-tp28614.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


More information about the rabbitmq-discuss mailing list