Open kensinzl opened 4 months ago
@yiliuTo could you take a look?
/cc @Azure/azsdk-sb-java
Hi @kensinzl Thank you for reporting this issue. We have received your submission and will take a look. We appreciate your input and will review this matter as soon as possible. Please feel free to provide any additional information or context that you think may be helpful. We'll keep you updated on the progress of our review.
Hey, is there any progress, seems no one take this issue to have a look
@yiliuTo @Netyyyy @joshfree any progress for this ticket? thanks
I'm stuck with a similar issue where I want to configure the @ServiceBusListener
to use PEEK_LOOK and to enable sessions on the consumer as the subscription has sessions enabled. Properties like
spring.cloud.azure.servicebus.processor.session-enabled=true
spring.cloud.azure.servicebus.processor.receive-mode=peek_lock
do not seem to work with the annotated listeners.
@kensinzl FYI: Managed to figure it out... Those properties don't configure the @ServiceBusListener
but seem to be for other approaches like ServiceBusClient
.
I've managed to configure the listeners with the following bean declaration.
@Bean
public PropertiesSupplier<ConsumerIdentifier, ProcessorProperties> propertiesSupplier() {
return key -> {
var processorProperties = new ProcessorProperties();
processorProperties.setEntityType(ServiceBusEntityType.TOPIC);
processorProperties.setReceiveMode(ServiceBusReceiveMode.PEEK_LOCK);
processorProperties.setSessionEnabled(Boolean.TRUE);
return processorProperties;
};
}
@nikoladjuran Hey man, thanks for the information.
I still use the @ServiceBusListener(Spring messaging) to monitor the service bus queue. If my understanding is correct, the @ServiceBusListener source code is using the default ServiceBusReceiveMode.PEEK_LOCK and also embed the commit to delete the message if successfully executed.
again, the document of azure is quite a mess, particularly the Java Azure SDK. Hopefully, I am on the right track.
Query/Question
PEEK_LOCK
andRECEIVE_AND_DELETE
of the ServiceBusReceiveMode, butspring.cloud.azure.servicebus.consumer.receive-mode=RECEIVE_AND_DELETE
orspring.cloud.azure.servicebus.processor.receive-mode=RECEIVE_AND_DELETE
at the application.properties file, the result seems stillPEEK_LOCK
, that means the message does not be deleted upon receivingmy question is how to configure the ServiceBusReceiveMode for the Java springboot if you use the annotation, eg: @ServiceBusListener
Setup (please complete the following information if applicable):