Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.31k stars 1.97k forks source link

Message Reciever doesn't work with the session enabled queue #21533

Closed z1069867141 closed 3 years ago

z1069867141 commented 3 years ago

Azure/azure-service-bus#326

abhikt48 commented 3 years ago

+1

Do we have any target for this functionalty?

We are using Qpid-JMS client to receive/publish messages. I am also getting same error exception in thread "main" javax.jms.JMSException: It is not possible for an entity that requires sessions to create a non-sessionful message receiver.

Can anyone please suggest - how can I receive/publish message with session enabled queue? Any hint/suggestion?

Regards, Abhishek Kumar

yiliuTo commented 3 years ago

Hi @abhikt48 , this feature is in our roadmap while is not under development now.

For receiving via JMSListener, after preliminary investigation, seems it's hard-code in Qpid-JMS client that all AMQP filter-set's key is jms-selector, while for Azure Service Bus, the required filter is com.microsoft:session-filter, so currently if you use the azure-spring-boot-starter-servicebus-jms, it's difficult to modify this behavior or receive from session enable queues.

For pubishing, you could use JmsTemplate to send messages and customized the message properties of JMSXGroupId with the value of the expected session-id.

Discussion is welcome.

abhikt48 commented 3 years ago

HI @yiliuTo, Thanks for update. I am able to send message with JMSXGroupId but not able to receive message from session enabled queue. Checked with qpid team , as per them com.microsoft:session-filter is an illegal filter. So they will not provide any option for this feature.

Looks like, we need to extend qpid library or get any other option from ServiceBus to consume session enabled messages..

yiliuTo commented 3 years ago

Hi @abhikt48 , yes I agree so, perhaps you could inverstigate if it's possible to extend the associated classes to customzied the filter key. Also I created an issue to the service bus repo to see if they could support is. ref: https://github.com/Azure/azure-service-bus/issues/444

sgcoates commented 3 years ago

Hi @abhikt48 did you manage to work aound this issue using JMS? I'm migrating a RabbitMQ Queue based message listener to Azure Service Bus and it requires the use of sessions to enforce FIFO message delivery. Currently using Spring Boot/Apache QPID, otherwise I'll investigate using AMQP directly. Thanks.

abhikt48 commented 3 years ago

Hi @sgcoates , we haven't managed to work around for this issue yet. We are still waiting from microsoft for any solution.

sgcoates commented 3 years ago

thanks for the prompt reply @abhikt48 - we've decided to avoid JMS for now and go directly with AMQP as described in this sample. It seems to honour the FIFO/Session requirements that we have. ReceiveNamedSessionAsyncSample.java

yiliuTo commented 3 years ago

Close this issue for it is not supported by service bus client. ref: https://github.com/Azure/azure-service-bus/issues/444