Closed jonasbark closed 3 years ago
@jialindai could you please assist in routing this azure-spring
issue
Hi, @jonasbark
I follow your configuration, When I'm trying to send a message, JmsListener it fails to connect.
When I change the configuration spring.jms.servicebus.topic-client-id
to my Service Bus subscription ID, it works.
spring.jms.servicebus.topic-client-id=[Your Subscription ID]
Hope it can help.
Hi @han-gao - thanks for replying!
What exactly do you mean with Subscription ID? The Azure Subscription ID? Or the actual subscription name (in my case "user" - see screenshot)?
I tried all different combinations but it still shows the same error message.
Hi @jonasbark
Not an Azure Subscription ID,
When you create a Service Bus in the portal, there is a Subscription ID on the Service Bus overview, such as the picture below,
Can you solve your problem?
Thank you - I put it in but still no luck for me. Same message I'm afraid.
Now that we're sure the spring.jms.servicebus.topic-client-id
part is correct, can we do the same with the other parameters?
spring.jms.servicebus.connection-string
:
JmsListener
:
@JmsListener(
destination = "user",
subscription = "user-read-write",
containerFactory = "jmsListenerContainerFactory"
)
Setup of JMS message listener invoker failed for destination 'user' - trying to recover. Cause: The messaging entity 'pass-servicebus-d-euwe-10c6dc:Topic:user|qpid-jms:receiver:ID:5e7c84f5-37dd-4b1a-8f69-ac4a8030f65d:1:1:3:user' could not be found. To know more visit https://aka.ms/sbResourceMgrExceptions. TrackingId:6b10c354-db1b-40c7-9bcb-ff175a435ce8_B16, SystemTracker:pass-servicebus-d-euwe-10c6dc:Topic:user|qpid-jms:receiver:ID:5e7c84f5-37dd-4b1a-8f69-ac4a8030f65d:1:1:3:user, Timestamp:2020-10-23T06:03:42 TrackingId:1f34b6844b894efcbdcb6e2fd864d6a7_G8, SystemTracker:gateway7, Timestamp:2020-10-23T06:03:42 [condition = amqp:not-found]
@jonasbark
Hi, Maybe your JmsListener
is not right.
@JmsListener(
destination = "user",
subscription = "user-read-write",
containerFactory = "jmsListenerContainerFactory" //This is the containerFactory for jms queue
)
You are using jms topic, so your JmsListener
should look like the following:
@JmsListener(
destination = "user",
subscription = "user-read-write",
containerFactory = "topicJmsListenerContainerFactory" //This is the containerFactory for jms topic
)
Can it work?
Yes... damn, I didn't catch that. Thanks a lot for your help!
Feel free to close.
I would suggest the Documentation to be updated because https://docs.microsoft.com/de-de/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-service-bus currently states:
spring.jms.servicebus.topic-client-id | Specify the JMS client ID if you're using an Azure Service Bus topic with a durable subscription.
It's not clear that the "Service Bus Subscription ID" is the JMS client ID.
Have a nice day! :)
@jafreck
I'm sorry I didn't read the news on the weekend. I used your configuration to reproduce your problem ,found that your @JmsListener
is incorrect.
As below:
I also found that the document is not very clear, the document will be updated immediately.
Have a nice day! :)
Describe the bug When I'm trying to create a JmsListener it fails to connect, stating that the messaging entity could not be found
Exception or Stack Trace
To Reproduce
add a Spring class:
Expected behavior Connection works and messages are received
Setup (please complete the following information):
Additional context Azure Configuration:
I double and triple checked the configuration. Sending messages to the topic works fine.