Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUERY] In Microsoft.Azure.ServiceBus how do we perform OnMessageAsync and OnCloseSessionAsync #11061

Closed
pvreddy37 opened this issue Apr 6, 2020 · 7 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus

Comments

@pvreddy37
Copy link

pvreddy37 commented Apr 6, 2020

hi People. Just need your help and assistance on the below questions.
Earlier we are using session queues with Microsoft.ServiceBus.Messaging with below approach

Current Appracoh:
creating a queue client and we are registering to RegisterSessionHandlerFactory( with a call back and Session handler)
We are inherting IMessageSessionAsyncHandler and overriding OnMessageAsync,OnCloseSessionAsync to handle messages and closing functionality of sessions.
we mainly depend on these member functions (OnMessageAsync,OnCloseSessionAsync ) to write our logic.

Current Problem : we are planning to migrate to use Microsoft.Azure.ServiceBus. and we didn't find an equivalent class or interface with which we can implement and override (OnMessageAsync,OnCloseSessionAsync ) and write our functionality

Note: We have implemented above mentioned current approach in continuous Web job. where we have callback which creates a factory method on each webjob instance

Is there any solution for this . or any other alternative. Thanks in advance

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 6, 2020
@pvreddy37
Copy link
Author

I See that we can use RegisterSessionHandler for OnMessageAsync.

But I didn't find an equivalent of OnCloseSessionAsync

OnCloseSessionAsync we have a use case that we notify the Listeners of the queue . And after notifying them they are suppose to take some action.

@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. Service Attention Workflow: This issue is responsible by Azure service team. Service Bus and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Apr 6, 2020
@ghost
Copy link

ghost commented Apr 6, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl.

@nemakam
Copy link
Contributor

nemakam commented Apr 6, 2020

@pvreddy37, Thanks for raising the issue.
Unfortunately, this feature isn't present in the Microsoft.Azure.ServiceBus library.
I'm going to mark this issue as a "FeatureRequest".
There's a new library that is being built right now and we will try to incorporate this into that library.

@jsquire @JoshLove-msft , FYI.

@nemakam nemakam added feature-request This issue requires a new behavior in the product in order be resolved. and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 6, 2020
@nemakam
Copy link
Contributor

nemakam commented Apr 6, 2020

There is no easy way to work around this. One hack you could try is poll on the session object for MessageSession.IsClosedOrClosing. If this is true, then call your handler. There is no inbuilt event that is raised when this happens, so you might have to implement a polling method to do the same.

@nemakam nemakam removed the Service Attention Workflow: This issue is responsible by Azure service team. label Apr 6, 2020
@JoshLove-msft
Copy link
Member

Hi @pvreddy37, can you elaborate on the action that the queue listener needs to take once the session is closed? Is the intent to track the number of sessions processed or is it a time-sensitive action that needs to happen precisely when we have stopped processing messages from a particular session?

@pvreddy37
Copy link
Author

Hi @JoshLove-msft : It is a time sensitive action that we need to take when we have stopped processing messages from a particular session. . Basically we configure MessageWaitTimeout = 3 minutes in SessionHandlerOptions() and if there is no message for 3 minutes we notify other users to take action.

@jsquire
Copy link
Member

jsquire commented Jun 2, 2020

This appears to have been resolved; the forthcoming Azure.Messaging.ServiceBus library now includes the requested event and discussion here seems to have concluded. I'm going to close this out; @pvreddy37, please feel free to reopen if you believe there is further discussion needed.

@jsquire jsquire closed this as completed Jun 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request This issue requires a new behavior in the product in order be resolved. Service Bus
Projects
None yet
Development

No branches or pull requests

5 participants