azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

[BUG]spring.cloud.azure.servicebus.processor.session-idle-timeout=PT10S is not reflecting in application

Open Sowmya192319 opened this issue 7 months ago • 7 comments

We have the spring application which consumes the message from the session enabled queue. we are trying to minimize the idle time between the session. though we are setting the property using the spring described one like spring.cloud.azure.servicebus.processor.session-idle-timeout=PT10S, changes are not reflecting. Still it is waiting for one minute to form the new connection

Exception or Stack Trace No exception... No chnages are reflecting after adding the property

To Reproduce Steps to reproduce the behavior:

Create the app service with 3 instances and send the message to the session enabled queue with different session ID. Code Snippet Add the code snippet that causes the issue.

Expected behavior Idle time should be to the value what we pass in the property of spring.cloud.azure.servicebus.processor.session-idle-timeout=PT10S

Screenshots If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: MAC or Linux or Windows
  • IDE: IntelliJ
  • Library/Libraries: azure starter service bus 5.22.0
  • Java version: 21
  • App Server/Environment: tomcat server
  • Frameworks: Spring Boot

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context Add any other context about the problem here.

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • [ ] Bug Description Added
  • [ ] Repro Steps Added
  • [ ] Setup information Added

Sowmya192319 avatar May 23 '25 13:05 Sowmya192319

There are two types of timeouts -

  1. session accept timeout
  2. Session idle timeout

The "session accept timeout" is the duration that service waits for a new session to available once client requested for "any" available session. The session accept timeout is set to 1 minute. It is not useful to change this duration, because if service informs the client that no sessions are currently available then there is not much to do other than retry and wait for a new session to be available in broker. The timeout-error in this case and its retry are internal and not surfaced to the application, but we can see the broker timeout message in logs.

The "session idle timeout" is the duration that client waits for the next message after connecting to a session. If this timeout expires then client will try to request next available session from service. The processor client builder allows only configuring the session idle timeout. The JavaDoc can be found here. The spring configuration you're using should be mapped to this.

Could you verify you're not seeing "session accept timeout" or if it's about "session idle timeout" spring config not reflecting. Looping in the spring team @saragluna

anuchandy avatar May 23 '25 15:05 anuchandy

Hi @Sowmya192319. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar May 25 '25 17:05 github-actions[bot]

Hello, Thanks for the reply. I am looking for session accept timeout modifications options.. We want to modify this timeout as per our requirements. Please suggest us how to make changes in the time ,a s we don't want our applications to wait for one minute to look for any available session

Sowmya192319 avatar May 26 '25 09:05 Sowmya192319

use case : We have the app service application running in multiple instances in app service plan It consumes the message from the session enabled queue. we sent the three messages with 3 different session Id's. First 2 messages consumed by the 2 instances. For the third message to get process, it has to wait for one minute

Current situation : We have lot of messages with different session Id's and we can't afford to wait for a minute for each message to get processing.

Expected: Ww want to keep the session active idle for 10 seconds, if we don't receive any messages with same session ID. It has to get close and available for the next message with different session ID get process

Changed the session idle timeout to 1 seconds. Still seeing the waiting period of 1 minute to switch from one session to another session.. Please provide the solution to reduce the waiting between the session.

Thanks, Sowmya

Sowmya192319 avatar May 26 '25 14:05 Sowmya192319

Hello, Thanks for the reply. I am looking for session accept timeout modifications options.. We want to modify this timeout as per our requirements. Please suggest us how to make changes in the time ,a s we don't want our applications to wait for one minute to look for any available session

Changing the accept timeout won't help. Let me explain with some examples -

  1. Let’s say no sessions available (because all are being consumed): o Client calls accept-session, broker starts wait timer, if 1-minute passes without no new sessions, broker returns timeout. Client retries. o Client calls accept-session, broker starts wait timer, after 10 seconds a new session is found, broker returns that session to client - The time client had to wait 10 seconds. o Client calls accept-session, broker starts wait timer, after 1 second a new session is found, broker returns session to client. - The time client had to wait 1 second. o
  2. One or more session available: o Client calls accept-session, broker doesn't start timer as session is already available, broker returns session immediately. - The time client had to wait is zero.

I think you are looking for the idle timeout.

anuchandy avatar May 26 '25 19:05 anuchandy

use case : We have the app service application running in multiple instances in app service plan It consumes the message from the session enabled queue. we sent the three messages with 3 different session Id's. First 2 messages consumed by the 2 instances. For the third message to get process, it has to wait for one minute

Current situation : We have lot of messages with different session Id's and we can't afford to wait for a minute for each message to get processing.

Expected: Ww want to keep the session active idle for 10 seconds, if we don't receive any messages with same session ID. It has to get close and available for the next message with different session ID get process

Changed the session idle timeout to 1 seconds. Still seeing the waiting period of 1 minute to switch from one session to another session.. Please provide the solution to reduce the waiting between the session.

Thanks, Sowmya

Hello @saragluna can someone from the spring team check this setting?

anuchandy avatar May 26 '25 19:05 anuchandy

Hello!! Any updates on this issue ?? thank you!

Sowmya192319 avatar Jun 04 '25 10:06 Sowmya192319