Comments (3)
Not explicitly available. But create a queue client in ReceiveAndDelete mode and don't do anything in the onMessage() handler. It will take sometime, but will do the job. Deleting all messages in a queue is fundamentally not supported by a broker. It supports only SEND and RECEIVE, not DELETE. But you can always delete the queue and recreate it.
from azure-service-bus-java.
To delete all messages in the queue , I am polling the queue till I receive no message and then call complete on each of those messages.
I am using MessageReceiver objects and will not be able to use QueueClients.
If any message has been locked by some receiver during this purge queue operation , it will never be received and hence , not be completed.
What can I do in this scenario ?
from azure-service-bus-java.
There is a receive mode called 'ReceiveAndDelete' which doesn't require client to complete the messages. A message is deleted on the queue before it is handed over to the client. That is faster than PeekLock receive followed by complete operation, if you need to purge the queue. When you are creating a receiver, you can specify 'ReceiveAndDelete' as the receive mode.
You can't do anything in that scenario, except waiting for the locked message to be completed by whatever client locked it or for the lock to expire and the message to be received by your purging client.
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.