Details
Description
Consider the following situation:
- The AdvisoryBroker sends a message to a non existent yet advisory topic. (a producer advisory, for example).
- The RegionBroker sends the request to the TopicRegion.
- The TopicRegion automatically creates the new topic, sending:
context.getBroker().addDestination(context, destination); - This eventually reaches again the AdvisoryBroker that adds the destination to its destination map.
Now, when the queue that triggered the creation of the advisory topic is deleted, the AdvisoryBroker attempts to delete the consumer and producer related topics, but doesn't clear them from its own destination map.
I'm attaching a proposed fix for the 4.1 branch, where:
- The AdvisoryBroker tries to delete those producer and consumer advisories from top of the broker.
- This is only made if the incoming destination is not a temporary itself, to avoid improper attempts to delete advisories of advisories.
In the trunk , the situation is different.
- The TopicRegion (actually in AbstracRegion code) creates the 'on demand' topics internally, without advising the RegionBroker.
- So, since the RegionBroker is not aware of these newly created topics, AdvisoryBroker attempts to delete the producer and consumer advisory topics are futile.