Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] JMS message listener invoker failed when listen to both servicebus queue and topic via jms at the same time #44470

Open
3 tasks done
liuqiaowei512 opened this issue Mar 3, 2025 · 2 comments
Assignees
Labels
azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@liuqiaowei512
Copy link

liuqiaowei512 commented Mar 3, 2025

Describe the bug
In same spring app using spring-cloud-azure-starter-servicebus-jms. If the app listens to both a servicebus queue and servicebus topic at the same time, connection error will appear.

Exception or Stack Trace

2025-03-03T10:52:06.431-06:00  WARN 28683 --- [windows.net:-1]] o.a.q.j.p.a.b.AmqpResourceBuilder        : Open of resource:(JmsConsumerInfo: { ID:4bdd3c46-54a7-4be3-b615-60510653b3eb:1:4:1, destination = a-test }) failed: The operation did not complete within the allocated time 00:01:05 for object attach. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:bcc3b36f1e3e49fdb5d286bf8803106e_G0, SystemTracker:gateway5, Timestamp:2025-03-03T16:52:06 [condition = com.microsoft:timeout]
2025-03-03T10:52:06.431-06:00  WARN 28683 --- [windows.net:-1]] o.a.q.j.p.a.b.AmqpResourceBuilder        : Open of resource:(JmsConsumerInfo: { ID:4bdd3c46-54a7-4be3-b615-60510653b3eb:1:1:1, destination = b-test }) failed: The operation did not complete within the allocated time 00:01:05 for object attach. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:bcc3b36f1e3e49fdb5d286bf8803106e_G0, SystemTracker:gateway5, Timestamp:2025-03-03T16:52:06 [condition = com.microsoft:timeout]
2025-03-03T10:52:06.432-06:00  WARN 28683 --- [windows.net:-1]] o.a.q.j.p.a.b.AmqpResourceBuilder        : Open of resource:(JmsConsumerInfo: { ID:4bdd3c46-54a7-4be3-b615-60510653b3eb:1:3:1, destination = c-test }) failed: The operation did not complete within the allocated time 00:01:05 for object attach. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:bcc3b36f1e3e49fdb5d286bf8803106e_G0, SystemTracker:gateway5, Timestamp:2025-03-03T16:52:06 [condition = com.microsoft:timeout]
2025-03-03T10:52:11.434-06:00  WARN 28683 --- [ntContainer#1-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'a-test' - trying to recover. Cause: The operation did not complete within the allocated time 00:01:05 for object attach. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:bcc3b36f1e3e49fdb5d286bf8803106e_G0, SystemTracker:gateway5, Timestamp:2025-03-03T16:52:06 [condition = com.microsoft:timeout]
2025-03-03T10:52:11.435-06:00  WARN 28683 --- [ntContainer#3-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'b-test' - trying to recover. Cause: The operation did not complete within the allocated time 00:01:05 for object attach. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:bcc3b36f1e3e49fdb5d286bf8803106e_G0, SystemTracker:gateway5, Timestamp:2025-03-03T16:52:06 [condition = com.microsoft:timeout]
2025-03-03T10:52:11.435-06:00  WARN 28683 --- [ntContainer#2-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'c-test' - trying to recover. Cause: The operation did not complete within the allocated time 00:01:05 for object attach. For more information on exception types and proper exception handling, please refer to http://go.microsoft.com/fwlink/?LinkId=761101 TrackingId:bcc3b36f1e3e49fdb5d286bf8803106e_G0, SystemTracker:gateway5, Timestamp:2025-03-03T16:52:06 [condition = com.microsoft:timeout]

To Reproduce
Listen to both queue and topic in the same app. Already tried below scenarios:

  1. Only listen to single/multiple servicebus queue via JMS. works fine
  2. Only listen to single/multiple servicebus topic via JMS. works fine
  3. Listen to 1 servicebus queue and 1 servicebus topic. Above exception will happen after period of time

Code Snippet

package com.debug.azure.controller;

import jakarta.jms.ConnectionFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.messaging.Message;

@RequiredArgsConstructor
@Slf4j
public class DebugAzureSBJms {
    @Bean
    public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(ConnectionFactory connectionFactory) {
        DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
        factory.setPubSubDomain(true);
        factory.setConnectionFactory(connectionFactory);
        factory.setSessionAcknowledgeMode(jakarta.jms.Session.AUTO_ACKNOWLEDGE);
        return factory;
    }

    @JmsListener(destination = "testtopic", containerFactory = "topicJmsListenerContainerFactory", subscription = "managerResponseTopic")
    public void receiveFromServicebusTopic(Message message) {
        log.info("Received msg from topic: {}", message);
    }

    @JmsListener(destination = "testqueue", containerFactory = "jmsListenerContainerFactory")
    public void receiveQueueMsg(Message message) {
        log.info("Received msg from queue: {}", message);
    }
}

Expected behavior
A single spring boot app should be able to listen to both servicebus queue and topic at the same time without erroring out

Screenshots
N/A

Setup (please complete the following information):

  • OS: MacOs, also Azure AppService
  • IDE: VSCode, Intellij
  • Library/Libraries: com.azure.spring:spring-cloud-azure-starter-servicebus-jms:5.12.0, springboot 3.2.3
  • Java version: 17
  • App Server/Environment: MacOS and App Service Linux
  • Frameworks: Springboot

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context
The production app listens to 3 servicebus queue and 1 servicebus topic at the same time. Which is why in the stack trace you will see JMS listener invoker failed for 3 destination. I also tried just one single servicebus queue and 1 single servicebus topic, same exception also happens

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
@github-actions github-actions bot added azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 3, 2025
Copy link
Contributor

github-actions bot commented Mar 3, 2025

Copy link
Contributor

github-actions bot commented Mar 3, 2025

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@liuqiaowei512 liuqiaowei512 changed the title [BUG] [BUG] JMS message listener invoker failed when listen to both servicebus queue and topic via jms at the same time Mar 3, 2025
@saragluna saragluna assigned Netyyyy and unassigned saragluna Mar 4, 2025
@saragluna saragluna modified the milestones: 2025-04, 2025-03 Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure-spring All azure-spring related issues Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Todo
Development

No branches or pull requests

3 participants