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/jms-developer-guide.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,15 @@ ms.date: 05/02/2023
10
10
11
11
This guide contains detailed information to help you succeed in communicating with Azure Service Bus using the Java Message Service (JMS) 2.0 API.
12
12
13
-
As a Java developer, if you're new to Azure Service Bus, please consider reading the below articles.
13
+
As a Java developer, if you're new to Azure Service Bus, consider reading the following articles.
14
14
15
15
| Getting started | Concepts |
16
16
|----------------|-------|
17
-
| <ul> <li> [What is Azure Service Bus](service-bus-messaging-overview.md) </li> <li> [Queues, Topics and Subscriptions](service-bus-queues-topics-subscriptions.md) </li> </ul> | <ul> <li> [Azure Service Bus - Premium tier](service-bus-premium-messaging.md) </li> </ul> |
17
+
| <ul> <li> [What is Azure Service Bus](service-bus-messaging-overview.md) </li> <li> [Queues, Topics, and Subscriptions](service-bus-queues-topics-subscriptions.md) </li> </ul> | <ul> <li> [Azure Service Bus - Premium tier](service-bus-premium-messaging.md) </li> </ul> |
18
18
19
19
## Java Message Service (JMS) Programming model
20
20
21
-
The Java Message Service API programming model is as shown below -
21
+
The Java Message Service API programming model is as shown in the following sections:
22
22
23
23
> [!NOTE]
24
24
>
@@ -50,9 +50,9 @@ The below building blocks are available to communicate with the JMS application.
50
50
### Connection factory
51
51
The connection factory object is used by the client to connect with the JMS provider. The connection factory encapsulates a set of connection configuration parameters that are defined by the administrator.
52
52
53
-
Each connection factory is an instance of `ConnectionFactory`, `QueueConnectionFactory` or `TopicConnectionFactory` interface.
53
+
Each connection factory is an instance of `ConnectionFactory`, `QueueConnectionFactory`, or `TopicConnectionFactory` interface.
54
54
55
-
To simplify connecting with Azure Service Bus, these interfaces are implemented through `ServiceBusJmsConnectionFactory`, `ServiceBusJmsQueueConnectionFactory` and`ServiceBusJmsTopicConnectionFactory` respectively.
55
+
To simplify connecting with Azure Service Bus, these interfaces are implemented through `ServiceBusJmsConnectionFactory`, `ServiceBusJmsQueueConnectionFactory`, or`ServiceBusJmsTopicConnectionFactory` respectively.
56
56
57
57
> [!IMPORTANT]
58
58
> Java applications leveraging JMS 2.0 API can connect to Azure Service Bus using the connection string, or using a `TokenCredential` for leveraging Microsoft Entra backed authentication. When using Microsoft Entra backed authentication, ensure to [assign roles and permissions](service-bus-managed-service-identity.md#azure-built-in-roles-for-azure-service-bus) to the identity as needed.
@@ -157,9 +157,9 @@ Destinations map to entities in Azure Service Bus - queues (in point to point sc
157
157
158
158
### Connections
159
159
160
-
A connection encapsulates a virtual connection with a JMS provider. With Azure Service Bus, this represents a stateful connection between the application and Azure Service Bus over AMQP.
160
+
A connection encapsulates a virtual connection with a JMS provider. With Azure Service Bus, it represents a stateful connection between the application and Azure Service Bus over AMQP.
161
161
162
-
A connection is created from the connection factory as shown below.
162
+
A connection is created from the connection factory as shown in the following example:
A session is a single-threaded context for producing and consuming messages. It can be utilized to create messages, message producers and consumers, but it also provides a transactional context to allow grouping of sends and receives into an atomic unit of work.
171
171
172
-
A session can be created from the connection object as shown below.
172
+
A session can be created from the connection object as shown in the following example:
A message consumer is an object that is created by a JMSContext or a Session and used for receiving messages sent to a destination. It can be created as shown below -
234
+
A message consumer is an object that is created by a JMSContext or a Session and used for receiving messages sent to a destination. It can be created as shown in this example:
@@ -256,7 +256,7 @@ Message m = consumer.receive(1000); // time out after one second.
256
256
257
257
#### Asynchronous receives with JMS message listeners
258
258
259
-
A message listener is an object that is used for asynchronous handling of messages on a destination. It implements the `MessageListener` interface which contains the `onMessage` method where the specific business logic must live.
259
+
A message listener is an object that is used for asynchronous handling of messages on a destination. It implements the `MessageListener` interface, which contains the `onMessage` method where the specific business logic must live.
260
260
261
261
A message listener object must be instantiated and registered against a specific message consumer using the `setMessageListener` method.
[JMS Message Consumers](#jms-message-consumers) are created against a [destination](#jms-destination) which may be a queue or a topic.
270
+
[JMS Message Consumers](#jms-message-consumers) are created against a [destination](#jms-destination), which can be a queue or a topic.
271
271
272
272
Consumers on queues are simply client side objects that live in the context of the Session (and Connection) between the client application and Azure Service Bus.
273
273
274
274
Consumers on topics, however, have 2 parts -
275
275
* A **client side object** that lives in the context of the Session(or JMSContext), and,
276
276
* A **subscription** that is an entity on Azure Service Bus.
277
277
278
-
The subscriptions are documented [here](java-message-service-20-entities.md#java-message-service-jms-subscriptions) and can be one of the below -
278
+
The subscriptions are documented [here](java-message-service-20-entities.md#java-message-service-jms-subscriptions) and can be one of the following ones:
279
279
* Shared durable subscriptions
280
280
* Shared non-durable subscriptions
281
281
* Unshared durable subscriptions
@@ -285,7 +285,7 @@ The subscriptions are documented [here](java-message-service-20-entities.md#java
285
285
286
286
The JMS API provides a `QueueBrowser` object that allows the application to browse the messages in the queue and display the header values for each message.
287
287
288
-
A Queue Browser can be created using the JMSContext as below.
288
+
A Queue Browser can be created using the JMSContext as in the following example:
0 commit comments