-
Notifications
You must be signed in to change notification settings - Fork 3
Self-healing subscriptions for native pub sub #4
Comments
@timbussmann Could you take a look at it? |
I like the idea, but thinking more about this I think there are some more questions on how transports providing native pubsub could benefit in the first place from file based pubsub (they can benefit from file based routing like any other transport). With the current ideas
using both "storages" together becomes tricky. E.g.
so this becomes quite tricky to manage properly. Thoughts @Scooletz ? |
@Scooletz @timbussmann the existence of In case of RabbitMQ I managed to implement automatic subscribe and unsubscribe here: Particular/NServiceBus.RabbitMQ#247. I hope similar thing can be done with ASB. The idea is following:
Rabbit ensures that no messages get duplicated because it automatically removes duplicates that end up in the same queue when routing. Not sure if ASB can do the same but even if no we can live with it because all ASB handlers are idempotent, are the? ;-) |
I think the key takeaway here is that Subscribe and unsubscribe should not be provided by the core as there are mechanisms where they just make no sense, e.g.
but it seems to me, that this doesn't necessarily belong to the transport, but to the pubsub mechanisms API? |
@timbussmann You are right. I did a mental shortcut and assumed that a pub/sub mechanism is provided by a transport but that is (and will be) not always the case. |
When using a transport that support a native pub sub mechanism, the
subscribe
part is handled in the following way: for every event that an endpoint wants to subscribe to a method is called resulting in calling a native transport API, registering the subscription.Consider a following case. An endpoint is shut down and the file has some of the event entries removed. When an endpoint is started again, it does not unsubscribe from the events. We could provide a self-healing mechanism, calling an unsubscribe when an event of a type that should not be handled is received.
The text was updated successfully, but these errors were encountered: