Azure / azure-servicebus-jms

Azure ServiceBus client using QPID for JMS users
MIT License
6 stars 5 forks source link

Enable a way for customers to be able to specify autodelete on entities created through JMS #36

Closed vinaysurya closed 6 months ago

vinaysurya commented 8 months ago

How will this work: When using ServiceBus JMS library, customer can additionally make use of the following APIs in the ServiceBusJmsConnectionFactorySettings to configure the AutoDeleteOnIdle behavior for entities created through this factory.

For Queues: setQueueAutoDeleteOnIdleDurationInSeconds(long queueAutoDeleteOnIdleDurationInSeconds); For Topics: setTopicAutoDeleteOnIdleDurationInSeconds(long topicAutoDeleteOnIdleDurationInSeconds); For Subscriptions: setSubscriberAutoDeleteOnIdleDurationInSeconds(long subscriberAutoDeleteOnIdleDurationInSeconds);

Once set, the service should monitor and honor the AutoDeleteOnIdle behavior by deleting the entity after specified period of inactivity.

When present on the factory any queue/topic/subscriber created through this factory will be created with AutoDeleteOnIdle enabled with that setting.

Caveats:

  1. If different queues/Topics need different AutoDeleteOnIdle timeout then customer will need to use different factories for that.
  2. Since JMS does not really have an update API, it will not be possible to Update the setting. The only way to update the property will be through ARM/portal for that entity.

It is also hard to add verifiable automated tests for this feature, as JMS has the behavior of dynamic creation of entities, if entities do not exist at the time of Send/Receive.

Hence sending a PR without those tests. The feature will be manually verified by setting it and then verifying from the Service that entity did get cleaned up by using a management tool like portal.