You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/service-bus-messaging/service-bus-java-how-to-use-jms-api-amqp.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ The Advanced Message Queuing Protocol (AMQP) 1.0 is an efficient, reliable, wire
25
25
Support for AMQP 1.0 in Azure Service Bus means that you can use the queuing and publish/subscribe brokered messaging features from a range of platforms using an efficient binary protocol. Furthermore, you can build applications comprised of components built using a mix of languages, frameworks, and operating systems.
26
26
27
27
## Get started with Service Bus
28
-
This guide assumes that you already have a Service Bus namespace containing a queue named **basicqueue**. If you do not, then you can [create the namespace and queue](service-bus-create-namespace-portal.md) using the [Azure portal](https://portal.azure.com). For more information about how to create Service Bus namespaces and queues, see [Get started with Service Bus queues](service-bus-dotnet-get-started-with-queues.md).
28
+
This guide assumes that you already have a Service Bus namespace containing a queue named `basicqueue`. If you don't, then you can [create the namespace and queue](service-bus-create-namespace-portal.md) using the [Azure portal](https://portal.azure.com). For more information about how to create Service Bus namespaces and queues, see [Get started with Service Bus queues](service-bus-dotnet-get-started-with-queues.md).
29
29
30
30
> [!NOTE]
31
31
> Partitioned queues and topics also support AMQP. For more information, see [Partitioned messaging entities](service-bus-partitioning.md) and [AMQP 1.0 support for Service Bus partitioned queues and topics](service-bus-partitioned-queues-and-topics-amqp-overview.md).
@@ -45,7 +45,7 @@ You must add the following four JAR files from the Apache Qpid JMS AMQP 1.0 dist
45
45
46
46
## Coding Java applications
47
47
### Java Naming and Directory Interface (JNDI)
48
-
JMS uses the Java Naming and Directory Interface (JNDI) to create a separation between logical names and physical names. Two types of JMS objects are resolved using JNDI: ConnectionFactory and Destination. JNDI uses a provider model into which you can plug different directory services to handle name resolution duties. The Apache Qpid JMS AMQP 1.0 library comes with a simple properties file-based JNDI Provider that is configured using a properties file of the following format:
48
+
JMS uses the Java Naming and Directory Interface (JNDI) to create a separation between logical names and physical names. Two types of JMS objects are resolved using JNDI: ConnectionFactory and Destination. JNDI uses a provider model into which you can plug different directory services to handle name resolution duties. The Apache Qpid JMS AMQP 1.0 library comes with a simple property file-based JNDI Provider that is configured using a properties file of the following format:
#### Setup JNDI context and Configure the ConnectionFactory
64
64
65
-
The **ConnectionString** referenced in the one available in the 'Shared Access Policies' in the [Azure Portal](https://portal.azure.com) under **Primary Connection String**
65
+
The **ConnectionString** referenced in the one available in the 'Shared Access Policies' in the [Azure portal](https://portal.azure.com) under **Primary Connection String**
66
66
```java
67
67
// The connection string builder is the only part of the azure-servicebus SDK library
68
68
// we use in this JMS sample and for the purpose of robustly parsing the Service Bus
@@ -132,7 +132,7 @@ Context context = new InitialContext(hashtable);
132
132
### A simple JMS application using a Service Bus queue
133
133
The following example program sends JMS TextMessages to a Service Bus queue with the JNDI logical name of QUEUE, and receives the messages back.
134
134
135
-
You can all access all the source code and configuration information from the [Azure Service Bus Samples JMS Queue Quick Start](https://github.com/Azure/azure-service-bus/tree/master/samples/Java/qpid-jms-client/JmsQueueQuickstart)
135
+
You can all access all the source code and configuration information from the [Azure Service Bus Samples JMS Queue quickstart](https://github.com/Azure/azure-service-bus/tree/master/samples/Java/qpid-jms-client/JmsQueueQuickstart)
Using Azure Service Bus topics and subscriptions through the Java Message Service (JMS) API provides basic send and receive capabilities. It's a convenient choice when porting applications from other message brokers with JMScompliant APIs, even though Service Bus topics differ from JMS Topics and require a few adjustments.
341
+
Using Azure Service Bus topics and subscriptions through the Java Message Service (JMS) API provides basic send and receive capabilities. It's a convenient choice when porting applications from other message brokers with JMS-compliant APIs, even though Service Bus topics differ from JMS Topics and require a few adjustments.
342
342
343
-
Azure Service Bus topics route messages into named, shared, durable subscriptions that are managed through the Azure Resource Management interface, the Azure commandline tools, or through the Azure portal. Each subscription allows for up to 2000 selection rules, each of which may have a filter condition and, for SQL filters, also a metadata transformation action. Each filter condition match selects the input message to be copied into the subscription.
343
+
Azure Service Bus topics route messages into named, shared, durable subscriptions that are managed through the Azure Resource Management interface, the Azure command-line tools, or through the Azure portal. Each subscription allows for up to 2000 selection rules, each of which may have a filter condition and, for SQL filters, also a metadata transformation action. Each filter condition match selects the input message to be copied into the subscription.
344
344
345
-
Receiving messages from subscriptions is identical receiving messages from queues. Each subscription has an associated dead-letter queue as well as the ability to automatically forward messages to another queue or topics.
345
+
Receiving messages from subscriptions is identical receiving messages from queues. Each subscription has an associated dead-letter queue and the ability to automatically forward messages to another queue or topics.
346
346
347
-
JMS Topics allow clients to dynamically create nondurable and durable subscribers that optionally allow filtering messages with message selectors. These unshared entities are not supported by Service Bus. The SQL filter rule syntax for Service Bus is, however, very similar to the message selector syntax supported by JMS.
347
+
JMS Topics allow clients to dynamically create nondurable and durable subscribers that optionally allow filtering messages with message selectors. These unshared entities aren't supported by Service Bus. The SQL filter rule syntax for Service Bus is, however, similar to the message selector syntax supported by JMS.
348
348
349
-
The JMS Topic publisher side is compatible with Service Bus, as shown in this sample, but dynamic subscribers are not. The following topology-related JMS APIs are not supported with Service Bus.
349
+
The JMS Topic publisher side is compatible with Service Bus, as shown in this sample, but dynamic subscribers aren't. The following topology-related JMS APIs aren't supported with Service Bus.
350
350
351
351
## Unsupported features and restrictions
352
352
The following restrictions exist when using JMS over AMQP 1.0 with Service Bus, namely:
353
353
354
354
* Only one **MessageProducer** or **MessageConsumer** is allowed per **Session**. If you need to create multiple **MessageProducers** or **MessageConsumers** in an application, create a dedicated **Session** for each of them.
355
-
* Volatile topic subscriptions are not currently supported.
356
-
***MessageSelectors**are not currently supported.
357
-
* Distributed transactions are not supported (but transacted sessions are supported).
355
+
* Volatile topic subscriptions aren't currently supported.
356
+
***MessageSelectors**aren't currently supported.
357
+
* Distributed transactions aren't supported (but transacted sessions are supported).
358
358
359
359
Additionally, Azure Service Bus splits the control plane from the data plane and therefore does not support several of
| createBrowser | unsupported. Use the Peek() functionality of the Service Bus API |
372
372
| createQueue | create a queue via management API/tools/portal |
373
373
| createTemporaryQueue | create a queue via management API/tools/portal with *AutoDeleteOnIdle* set to an expiration period |
374
-
| receiveNoWait |utilize the receive() method provided by the Service Bus SDK and specify a very low or zero timeout |
374
+
| receiveNoWait |use the receive() method provided by the Service Bus SDK and specify a very low or zero timeout |
375
375
376
376
## Summary
377
377
This how-to guide showed how to use Service Bus brokered messaging features (queues and publish/subscribe topics) from Java using the popular JMS API and AMQP 1.0.
0 commit comments