Share via

How to fix issue with subscribing to a message in my .net application from a topic

Boddu, Yashwanth 0 Reputation points
2026-01-29T11:49:20.2566667+00:00

Facing issue with processing message from servicebus topic in .net application.
The subscribing service is part of applicaiton which has reference to project where Messagehandler is implemented. Service bus message is reaching the subscription but my service is not getting the message.
Below attaching references.
User's image

User's image

Developer technologies | .NET | .NET Runtime
0 comments No comments

1 answer

Sort by: Most helpful
  1. Jack Dang (WICLOUD CORPORATION) 17,425 Reputation points Microsoft External Staff Moderator
    2026-01-30T09:09:04.54+00:00

    Hi @Boddu, Yashwanth ,

    Thanks for reaching out.

    It looks like the main issue is that your OutboundCommunicationEventHub class is trying to implement the same generic interface IAsbMessageProcessor twice with different types (EmailRequestMessage and SMSRequestMessage). In C#, this isn’t allowed because both implementations define a ProcessMessage method with the same name, which causes a conflict. That’s why your service never gets the messages.

    To resolve this, you have a few options:

    1. Create one class to handle emails and another for SMS. Each class implements IAsbMessageProcessor<T> for its specific type. This is the simplest approach and keeps things clear.
    2. Define a common interface without the generic parameter, then have each message type implement it. Your handler can then work with the base interface and delegate to the correct processor internally.
    3. Keep one central class that receives all messages but routes them to the appropriate processor based on the message type.

    Option 1 is usually the quickest to get working, while options 2 or 3 give more flexibility if you plan to handle more message types in the future.

    Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.