-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
AzureServiceBus: Local transactions cannot span multiple top-level entities such as queue or topic #137
Comments
I don't know anything about AzureSB but it should work. "Cross entity transactions" is supported if Q:
I upgraded the version of qpid and other dependent jars used by the azure client just in case...but I don't think it will change anything |
Dear @titou10titou10 , I can confirm that the error occurs with any queue and in any order. You can open one queue and any attempt to open a different queue will prompt the error. Apart from the applications that I develop the only JMS client I use is JMSToolBox :) . If that is of any help, using the same stack used in the apps, I wrote a unit test that browses several queues without errors from AzureServiceBus can be browsed. package samples.azsbuscalculator.browser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.QueueBrowser;
import javax.jms.Session;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jms.core.JmsTemplate;
@SpringBootTest
class BrowseQueueTest {
@Autowired
private JmsTemplate template;
@Test
void testBrowseQueues() {
List<String> names = Arrays.asList(
"calculator/inbox",
"calculator/outbox",
"calculator/inbox/$deadletterqueue",
"calculator/outbox/$deadletterqueue");
for (String queueName : names) {
List<String> details = this.template.browse(queueName,
SendMessageTest::browseQueue);
System.out.println(queueName + ": " + details.size() + " messages");
if (! details.isEmpty()) {
for (String summary : details) {
System.out.println(" " + summary);
}
}
}
}
private static List<String> browseQueue(Session session, QueueBrowser browser) throws JMSException {
List<String> result = new ArrayList<>();
Enumeration enumeration = browser.getEnumeration();
while (enumeration.hasMoreElements()) {
Message message = (Message) enumeration.nextElement();
Date jmsTimestamp = new Date(message.getJMSTimestamp());
result.add(jmsTimestamp + " - " + message.getJMSMessageID());
}
return result;
}
} The project containing this test was generated with Spring Initialzr:
After generating the project, the dependency for service bus is added as recommended in the article https://docs.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-service-bus <!-- AZURE SERVICE BUS -->
<dependency>
<groupId>com.azure.spring</groupId>
<artifactId>spring-cloud-azure-starter-servicebus-jms</artifactId>
<version>4.3.0</version>
</dependency> Configuration is done as per the article with properties:
Kind regards |
I guess that the code above just open a JMS JTB open a JMS jmstoolbox/org.titou10.jtb.core/src/org/titou10/jtb/jms/model/JTBConnection.java Line 268 in 4cab4f6
|
Running the test above creates a single session with the method org.apache.qpid.jms.JmsConnection.createSession(boolean, int) with following argument values:
|
Hi @titou10titou10 , It seems that Azure Service Bus imposes restrictions when used in a transacted context: see comment Azure/azure-sdk-for-java#29881 (comment) . As a conclusion this issue is not resolvable in the jmstoolbox :( Kind regards |
Thanks for your feed back. This is a serious limitation of the Azure SB SDK... |
Specifications
Expected Behavior
As for other Q providers, to be able to view the content of more than one queue within an open session
Actual Behavior
When trying to open a second queue, the following error message is shown:
org.apache.qpid.jms.provider.ProviderException: Local transactions cannot span multiple top-level entities such as queue or topic. TrackingId:b328e537ae6e4dafb967a1e1883165fd_G10S2, SystemTracker:gateway5, Timestamp:2022-07-06T06:45:41 [condition = amqp:not-allowed]
Local transactions cannot span multiple top-level entities such as queue or topic. TrackingId:b328e537ae6e4dafb967a1e1883165fd_G10S2, SystemTracker:gateway5, Timestamp:2022-07-06T06:45:41 [condition = amqp:not-allowed]
Steps to Reproduce the Problem
Logs
"<user>\.jtb\JMSToolBox\jmstoolbox.log"
jmstoolbox.log
"<user>\.jtb\.metadata\.log"
.log
The text was updated successfully, but these errors were encountered: