title: How to resend a message to a specific subscriber?
body: <p><em>Background:</em> </p>
  
  <p>We have a messaging subsystem based on MassTransit. It works great, pumps thousands of messages with only minor issues. So far,  failed messages were automatically pushed to <code>xxx_error</code> queues. This also works great. </p>
  
  <p>We even had our own web-based management console to peek into message queues and resend failed messages. The tool was based on the <strong>BusDriver</strong> example and worked directly on MSMQ - it copies messages from <code>xxx_error</code> to <code>xxx</code> and they are resent.</p>
  
  <p><em>Current situation:</em> </p>
  
  <p>We consider moving to RabbitMQ, it seems faster and more scalable. But of course, the MSMQ management console becomes useless, I don't like to write yet another version of the console to work on RabbitMQ queues. I would rather go with a generic route where I put failed messages into my own repository which would be independent on the MSMQ transport.</p>
  
  <p>Sounds easy. And this is where we have a specific question.</p>
  
  <p>The repository of failed messages will contain (among other attributes) the message body and the message subscriber name. Later, I can go to the repository, deserialize the message and resend it to a specific subscriber.</p>
  
  <p>But, we don't want to <code>bus.Publish( msg )</code> as the message would again hit <strong>all</strong> subscribers rather than the one which failed previously. What we want is to resend the message to precisely one subscriber. </p>
  
  <p>This seems possible with:</p>
  
  <pre><code>senderbus.GetEndpoint( new Uri( "rabbitmq://servername/subscriber1" ) ).Send( msg );
  </code></pre>
  
  <p>or</p>
  
  <pre><code>senderbus.GetEndpoint( new Uri( "msmq://localhost/subscriber1" ) ).Send( msg );
  </code></pre>
  
  <p>(depending on the transport used). With this approach, the message is delivered to the only specific subscriber.</p>
  
  <p><em>The question is:</em> </p>
  
  <p><strong>Would this be the recommended approach</strong>? What alternatives do we have?</p>
  
  <p>The possible problem is that this approach probably ignores the information on current subscriptions and delivers the message directly to the subscriber queue. However, the subscriber possibly no longer subscribes to messages of the type. So, the code should possibly be something like:</p>
  
  <pre><code>if ( subscriber1 still subscribes to messages of msg.GetType() ) &lt;- how do to this?
     senderbus.GetEndpoint( new Uri( "rabbitmq://servername/subscriber1" ) ).Send( msg );
  </code></pre>
  
  <p>Thanks in advance for any comments on this. </p>