Package com.azure.core.amqp
Class AmqpClientOptions
java.lang.Object
com.azure.core.util.ClientOptions
com.azure.core.amqp.AmqpClientOptions
General configuration options for AMQP clients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the identifier for the AMQP client.setApplicationId
(String applicationId) Sets the application ID.setHeaders
(Iterable<Header> headers) Sets theHeaders
.setIdentifier
(String identifier) Sets the identifier for the AMQP client.Methods inherited from class com.azure.core.util.ClientOptions
getApplicationId, getHeaders, getMetricsOptions, setMetricsOptions
-
Constructor Details
-
AmqpClientOptions
public AmqpClientOptions()
-
-
Method Details
-
setApplicationId
Sets the application ID.The
applicationId
is used to configureUserAgentPolicy
for telemetry/monitoring purposes.See Azure Core: Telemetry policy for additional information.
Code Samples
Create ClientOptions with application ID 'myApplicationId'
ClientOptions clientOptions = new ClientOptions() .setApplicationId("myApplicationId");
- Overrides:
setApplicationId
in classClientOptions
- Parameters:
applicationId
- The application ID.- Returns:
- The updated ClientOptions object.
-
setHeaders
Sets theHeaders
.The passed headers are applied to each request sent with the client.
This overwrites all previously set headers.
Code Samples
Create ClientOptions with Header 'myCustomHeader':'myStaticValue'
ClientOptions clientOptions = new ClientOptions() .setHeaders(Collections.singletonList(new Header("myCustomHeader", "myStaticValue")));
- Overrides:
setHeaders
in classClientOptions
- Parameters:
headers
- The headers.- Returns:
- The updated
ClientOptions
object.
-
getIdentifier
Gets the identifier for the AMQP client.- Returns:
- AMQP client identifier.
-
setIdentifier
Sets the identifier for the AMQP client.- Parameters:
identifier
- A specific string to identify AMQP client. If null or empty, a UUID will be used as the identifier.- Returns:
- The updated
AmqpClientOptions
object.
-