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
+35-8Lines changed: 35 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Each connection factory is an instance of `ConnectionFactory`, `QueueConnectionF
54
54
To simplify connecting with Azure Service Bus, these interfaces are implemented through `ServiceBusJmsConnectionFactory`, `ServiceBusJmsQueueConnectionFactory` and `ServiceBusJmsTopicConnectionFactory` respectively.
55
55
56
56
> [!IMPORTANT]
57
-
> Java applications leveraging JMS 2.0 API can connect to Azure Service Bus using the connection string, or using a `TokenCredential` for leveraging Azure Active Directory (AAD) backed authentication.
57
+
> Java applications leveraging JMS 2.0 API can connect to Azure Service Bus using the connection string, or using a `TokenCredential` for leveraging Azure Active Directory (AAD) backed authentication. When using AAD backed authentication, ensure to [assign roles and permissions](service-bus-managed-service-identity.md#assigning-azure-roles-for-access-rights) to the identity as needed.
Create a [service principal](authenticate-application.md#register-your-application-with-an-azure-ad-tenant) on Azure, and use this identity to create a `TokenCredential`.
110
+
111
+
```java
112
+
TokenCredential tokenCredential =new new ClientSecretCredentialBuilder()
113
+
.tenantId("")
114
+
.clientId("")
115
+
.clientSecret("")
116
+
.build();;
117
+
```
118
+
119
+
The Connection factory can then be instantiated with the below parameters.
120
+
* Token credential - Represents a credential capable of providing an OAuth token.
121
+
* Host - the hostname of the Azure Service Bus Premium tier namespace.
122
+
* ServiceBusJmsConnectionFactorySettings property bag, which contains
123
+
* connectionIdleTimeoutMS - idle connection timeout in milliseconds.
124
+
* traceFrames - boolean flag to collect AMQP trace frames for debugging.
125
+
**other configuration parameters*
126
+
127
+
The factory can be created as shown here. The token credential and host are required parameters, but the other properties are optional.
0 commit comments