-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for publish/subscribe interface implementations #67
Comments
publishing a base class doesn't really make sense. you should publish concrete implementations and subscribe to interfaces. |
You are right, but it was just an example. Subscribing to interfaces does not work either, even with published concrete implementations derived from the interface.
The GetMessageTypeName() method from the SubscriptionFactory.cs file does not seem to handle interfaces. Why does it actually remove the "I" from the interface type name ?
|
IIRC the implementation here was done with the idea of just subscribing to interfaces, not for message versioning. The integration tests are here: Given the current implementation you could:
You'd need to configure the subscriptions and publishers to do this. |
Thank you for the reply, I will look into that. |
@abrasat I'm actually not sure what would happen if you tried to puhblish an interface, it would probably work but you'd need to configure the exchange explicitly. That said you need to be careful in general when serializing interface types, regardless of whether or not you use this library, e.g. how would you serialize an |
I tried to test a publish/subscribe scenario with interface implementations and could not get it working.
I defined some message classes:
and then published the message:
The subscriber looks like this, but no messages are received.
If I explicitly publish/subscribe the derived classes instead of the interface, the messages are received correctly.
Is there any possiblity to use an interface or base abstract class for messages?
The text was updated successfully, but these errors were encountered: