The entire idea behind MessagingEntityCreationOptions.CreateAsTemporary is that the framework will clean up the messaging entity when it's no longer being used.
The challenge here is that many MessageSource/MessagePublisher instances may be referencing the same temporary entity and we can only clean it up once we know all of those instances that are referencing it have been thrown away. I think this will require some kind of reference counting mechanism on the MessageTypePathMappingDetails instance that the MessageSource'/'MessagePublisher' instances will decrement in their ownDisposeimplementations. once the ref count reacheszerotheMessageTypePathMappingDetails` could perform the clean up of its temporary messaging entity.
The entire idea behind
MessagingEntityCreationOptions.CreateAsTemporaryis that the framework will clean up the messaging entity when it's no longer being used.The challenge here is that many
MessageSource/MessagePublisherinstances may be referencing the same temporary entity and we can only clean it up once we know all of those instances that are referencing it have been thrown away. I think this will require some kind of reference counting mechanism on theMessageTypePathMappingDetailsinstance that theMessageSource'/'MessagePublisher' instances will decrement in their ownDisposeimplementations. once the ref count reacheszerotheMessageTypePathMappingDetails` could perform the clean up of its temporary messaging entity.