Comments (7)
I've tested the suggested types of acknowledgement and ACCEPTED, REJECTED and RELEASED are working as expected. But when I tried using the MODIFIED_FAILED mode, I expected the message to get redelivered as many times as is the Max Delivery Count property value on the queue I was working with. And that I could see it later in the DLQ with the usual "delivery count exceeded" comment.
But instead it was behaving exactly the same way the MODIFIED_FAILED_UNDELIVERABLE mode - message got deferred instantly.
from azure-service-bus-java.
DEFERRED is a valid state for a message in service bus. A deferred message is in the same queue, but not at the top of the queue any more. It can be received only with a special operation called 'receiveBySequenceNumber'. Because of AMQP doesn't natively understand Deferred as a state, it is internally implemented as MODIFIED outcome with undeliverable-here set to true.
So if an AMQP client receives a message, but if instead of accepting the delivery, it sends a delivery state of MODIFIED means the message is abandoned and delivery count is incremented. If the receiver sends a delivery state of MODIFIED with undeliverable-here set to true, the message is deferred. In your case, the exception is thrown in the processing code, your JMS library is sending MODIFIED with undeliverable-here set to true, which is causing the message to be deferred. If you can tweak that, your problem will be solved.
Instead, your client can send a disposition with state REJECTED and the message will be dead-lettered right away.
from azure-service-bus-java.
to add.
- you need to use client ack mode
- take a look at this: https://issues.apache.org/jira/browse/QPIDJMS-121 with latest qpid JMS you can set the ack type to amqp.
- below is the map between AMQP disposition and Service Bus semantics.
ACCEPTED = 1; -> Complete()
REJECTED = 2; -> DeadLetter()
RELEASED = 3; (just unlock the message in service bus, will then get redelivered)
MODIFIED_FAILED = 4; -> Abandon() which increases delivery count
MODIFIED_FAILED_UNDELIVERABLE = 5; -> Defer()
from azure-service-bus-java.
Thanks for the suggestion! I'll try using it as soon as I get back to work after this weekend.
Is this approach commonly used? As this is the first time I've heard of it.
from azure-service-bus-java.
@Draczech sorry for delayed response. Could you please turn on trace and past the traced frame for MODIFIED_FAILED?
Trace can be turned on as explained here: https://qpid.apache.org/releases/qpid-jms-0.23.0/docs/index.html#logging
from azure-service-bus-java.
SorryI could not get to the issue earlier. Now I have some time available for improving my messaging library with different types of ACK as described above so I am back on the issue...
I tried logging what exactly happens on using MODIFIED_FAILED ack. Apparently the message is redelivered immediately which results in expiration I guess as I have JmsRedeliveryPolicy set for 0 redeliveries (as they used to cause some trouble earlier).
You can see the described behaviour in log: message_delivery_log.txt
I thought that the JmsRedeliveryPolicy works for local redelivery only. And that if I use RELEASED as default outcome of JmsRedeliveryPolicy, the DeliveryCount property on the message in Service Bus Queue message should not change. Apparently I was wrong. The message always ends up with DeliveryCount at 3 and at deferred state. Which leads me to another question:
Is the delivery count on ConnectionFactory connected to Max Delivery Count in Service Bus?
from azure-service-bus-java.
@axisc HI. What the reason to close?
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.