Common Interface For Sending Messages

We are building a common logging solution to handle many different types of errors. For the solution we have some common code to send messages to a specific queue that all projects could reference. We were hoping to have one interface that we could reference that would have the send and publish methods but it looks like there are two.

I found IMessageSession that has send, publish, subscribe, and unsubscribe. I also found IPipelineContext which implements send and publish.

Couldn’t IMessageSession implement IPipelineContext and then extend it more with subscribe and unsubscribe?

We have it working with an overload with the two different types more just curious if this is something that is possible in a future release?

Perhaps I’m missing something here. IMessageSession already gives you all the operations you’ve asked for:

  • Send
  • Publish
  • Subscribe
  • Unsubscribe

IMessageSession is used outside of a handler context. If you’re in a handler, then it’s the IMessageHandlerContext that is passed into your handler. Could you elaborate on what are you trying to do?

I also wonder if you’re trying to implement something like a unified session, which is usually a case where customers used the IBus everywhere and can’t refactor the code away from that w/o too much investment. Have a look but note that for new projects I would recommend using clearly separated interfaces.