Skip to content

Commit d3c1f53

Browse files
committed
acrolynx
1 parent 4c46915 commit d3c1f53

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

articles/service-bus-messaging/jms-developer-guide.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ ms.date: 05/02/2023
1010

1111
This guide contains detailed information to help you succeed in communicating with Azure Service Bus using the Java Message Service (JMS) 2.0 API.
1212

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.
1414

1515
| Getting started | Concepts |
1616
|----------------|-------|
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> |
1818

1919
## Java Message Service (JMS) Programming model
2020

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:
2222

2323
> [!NOTE]
2424
>
@@ -50,9 +50,9 @@ The below building blocks are available to communicate with the JMS application.
5050
### Connection factory
5151
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.
5252

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.
5454

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.
5656

5757
> [!IMPORTANT]
5858
> 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
157157

158158
### Connections
159159

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.
161161

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:
163163

164164
```java
165165
Connection connection = factory.createConnection();
@@ -169,7 +169,7 @@ Connection connection = factory.createConnection();
169169

170170
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.
171171

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:
173173

174174
```java
175175
Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
@@ -217,21 +217,21 @@ When the mode isn't specified, the **JMSContext.AUTO_ACKNOWLEDGE** is picked by
217217

218218
A message producer is an object that is created using a JMSContext or a Session and used for sending messages to a destination.
219219

220-
It can be created either as a stand-alone object as below -
220+
It can be created either as a stand-alone object as shown in the following example:
221221

222222
```java
223223
JMSProducer producer = context.createProducer();
224224
```
225225

226-
or created at runtime when a message is needed to be sent.
226+
Or created at runtime when a message is needed to be sent.
227227

228228
```java
229229
context.createProducer().send(destination, message);
230230
```
231231

232232
### JMS message consumers
233233

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 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:
235235

236236
```java
237237
JMSConsumer consumer = context.createConsumer(dest);
@@ -256,7 +256,7 @@ Message m = consumer.receive(1000); // time out after one second.
256256

257257
#### Asynchronous receives with JMS message listeners
258258

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.
260260

261261
A message listener object must be instantiated and registered against a specific message consumer using the `setMessageListener` method.
262262

@@ -267,15 +267,15 @@ consumer.setMessageListener(myListener);
267267

268268
### Consuming from topics
269269

270-
[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.
271271

272272
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.
273273

274274
Consumers on topics, however, have 2 parts -
275275
* A **client side object** that lives in the context of the Session(or JMSContext), and,
276276
* A **subscription** that is an entity on Azure Service Bus.
277277

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:
279279
* Shared durable subscriptions
280280
* Shared non-durable subscriptions
281281
* Unshared durable subscriptions
@@ -285,7 +285,7 @@ The subscriptions are documented [here](java-message-service-20-entities.md#java
285285

286286
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.
287287

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:
289289

290290
```java
291291
QueueBrowser browser = context.createBrowser(queue);
@@ -326,7 +326,7 @@ This developer guide showcased how Java client applications using Java Message S
326326

327327
## Next steps
328328

329-
For more information on Azure Service Bus and details about Java Message Service (JMS) entities, check out the links below -
329+
For more information on Azure Service Bus and details about Java Message Service (JMS) entities, check out the following articles:
330330
* [Service Bus - Queues, Topics, and Subscriptions](service-bus-queues-topics-subscriptions.md)
331331
* [Service Bus - Java Message Service entities](service-bus-queues-topics-subscriptions.md#java-message-service-jms-20-entities)
332332
* [AMQP 1.0 support in Azure Service Bus](service-bus-amqp-overview.md)

0 commit comments

Comments
 (0)