Comments (5)
@sharadholani - This is a new feature, that would need to be implemented by the service. With that said, what is the use case here?
I ask because even with a "shorter" lock duration of 30 seconds, our MessageHandler will automatically renew the lock for you. And generally speaking it is a bad practice to set a lock for a long duration. This is because a crashed process early on would keep that message from being re-delivered. i.e. its locked until the long lock expires.
from azure-service-bus-java.
We are not using QueueClient APIs. We are creating MessageReceiver objects directly and calling receive() , whenever we need to fetch messages.
I need to specify the message visibility timeout period when we make to call to get messages from service bus.
If this timeout period is less than the time required to process it, I would increase the lock duration by a specified amount by making an explicit call.
This feature is there in SQS and Azure Storage queue.
Our clients who would be moving from SQS to Service Bus would need a similar feature. Hence we would be needing APIs to control the visibility timeout period for a message.
from azure-service-bus-java.
@sharadholani - We generally recommend using the Queue/Topic/Subscription client API's as it can help solve some of these issues for you, and the Message Sender/Receiver is more for advanced scenarios that aren't met by the simplicity of the clients.
While the new feature that you have recommended is something that we can consider, its not currently on our road map, and therefore there is no time frame associated with it. If you'd like to officially request it, please do so in our 'parent' repo: https://github.com/azure/azure-service-bus
In the meantime, you probably have two choices:
- Use the
MessageHandler
that is available in the Queue/Subscription clients, which will renew the lock for you as needed. - Continue using the
MessageReceiver
and manually renew the lock when themessage.getExpiresAtUtc()
is within 10 seconds of expiring. In order to do this, you will need to start a new thread.
from azure-service-bus-java.
QueueClient registers an IMessageHandler object which has onMessageAsync function. This function is invoked whenever there is a message in the queue.
In our case , we need to receive messages on Demand. The client can ask at any instant to get messages from queue. Only then are we supposed to query the queue for messages.
That is why we are using MessageReceiver objects directly instead of QueueClient .
Hence the issue with message locks.
Will the QueueClient have this on demand receive messages from the queue feature anytime soon ?
from azure-service-bus-java.
@sharadholani - I'm going to close this issue for now, as this isn't something that we are able to focus on during preview. As we've discussed outside of this thread, I think the best thing to do would be to create an extension method that will handle renewing the lock for you on the receiver.
from azure-service-bus-java.
Related Issues (20)
- MessageAndSessionPump closes the connection on the receipt of SIGTERM.
- Memory Leak
- receiveMessages method with maxWaitTime not working as expected
- @ServiceBusQueueTrigger MSI authentication
- Azure service bus jar changing default Spring Boot behavior HOT 9
- ServiceBusSenderClient sendMessage method doesn't return MessageId after pushing the message to the queue/topic HOT 1
- Getting "ReactorDispatcher instance is closed" error when trying to close the azure service bus connection after receiving message HOT 14
- How to setup Message Listener to pickup message immediately on arrival (Pricing Tier: Basic)
- Azure event hub connection is closed error HOT 1
- Error occurred while refreshing token that is not retriable. Not scheduling refresh task.
- Infinite Receiver/Subscriber Issue | Java 11 | Spring Boot 2.5.* HOT 2
- Error processing ASB queues with Spring Boot and Apache Camel
- Transaction acknowledgement issue
- This repo is missing important files
- How can I get message attributes in Azure func
- LockRenewalOperation exception when marking message as abandon/complete on same client HOT 1
- Inconsistent Behavior of getLockedUntil() Method for Messages Received from Azure Service Bus Queue
- Consumer Fails to Reconnect and Consume Messages with Apache Qpid JMS Client (Version 0.51.0)
- Service Bus Client Mock Bean creation
- Security vulnerability in version 7.14.3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-service-bus-java.