-
Notifications
You must be signed in to change notification settings - Fork 224
/
com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.yml
217 lines (217 loc) · 30.9 KB
/
com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
### YamlMime:JavaType
uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder"
name: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder"
summary: "Builder for creating <xref uid=\"com.azure.messaging.servicebus.ServiceBusProcessorClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClient\"></xref> to consume messages from a session-based Service Bus entity."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder**"
methods:
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.buildProcessorClient()"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.buildProcessorClient()"
name: "buildProcessorClient()"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.buildProcessorClient()"
summary: "Creates a **session-aware** Service Bus processor responsible for reading <xref uid=\"com.azure.messaging.servicebus.ServiceBusReceivedMessage\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messages\"></xref> from a specific queue or subscription."
syntax: "public ServiceBusProcessorClient buildProcessorClient()"
desc: "Creates a **session-aware** Service Bus processor responsible for reading <xref uid=\"com.azure.messaging.servicebus.ServiceBusReceivedMessage\" data-throw-if-not-resolved=\"false\" data-raw-source=\"messages\"></xref> from a specific queue or subscription."
returns:
description: "An new <xref uid=\"com.azure.messaging.servicebus.ServiceBusProcessorClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClient\"></xref> that receives messages from a queue or subscription."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusProcessorClient?alt=com.azure.messaging.servicebus.ServiceBusProcessorClient&text=ServiceBusProcessorClient\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.disableAutoComplete()"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.disableAutoComplete()"
name: "disableAutoComplete()"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.disableAutoComplete()"
summary: "Disables auto-complete and auto-abandon of received messages."
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder disableAutoComplete()"
desc: "Disables auto-complete and auto-abandon of received messages. By default, a successfully processed message is <xref uid=\"com.azure.messaging.servicebus.ServiceBusReceivedMessageContext.complete()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"completed\"></xref>. If an error happens when the message is processed, it is <xref uid=\"com.azure.messaging.servicebus.ServiceBusReceivedMessageContext.abandon()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"abandoned\"></xref>."
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxAutoLockRenewDuration(java.time.Duration)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxAutoLockRenewDuration(Duration maxAutoLockRenewDuration)"
name: "maxAutoLockRenewDuration(Duration maxAutoLockRenewDuration)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxAutoLockRenewDuration(Duration maxAutoLockRenewDuration)"
summary: "Sets the amount of time to continue auto-renewing the lock."
parameters:
- description: "the amount of time to continue auto-renewing the lock. <xref uid=\"java.time.Duration.ZERO\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration#ZERO\"></xref>\n or <code>null</code> indicates that auto-renewal is disabled."
name: "maxAutoLockRenewDuration"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder maxAutoLockRenewDuration(Duration maxAutoLockRenewDuration)"
desc: "Sets the amount of time to continue auto-renewing the lock. Setting <xref uid=\"java.time.Duration.ZERO\" data-throw-if-not-resolved=\"false\" data-raw-source=\"Duration#ZERO\"></xref> or `null` disables auto-renewal. For <xref uid=\"com.azure.messaging.servicebus.models.ServiceBusReceiveMode.RECEIVE_AND_DELETE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RECEIVE_AND_DELETE\"></xref> mode, auto-renewal is disabled.\n\nA Service Bus queue or subscription in a topic will have a lock duration set at the resource level. When the processor client connect to a session in the resource, the broker will apply an initial lock to the session. This initial lock lasts for the lock duration set at the resource level. If the client does not renew the initial lock before it expires then the session will be released and become available for other receivers. Each time the client renews the lock, the broker will extend the lock for the lock duration set at the resource level. To keep the session locked, the client will have to continuously renew the session lock before its expiration. `maxAutoLockRenewDuration` controls how long the background renewal task runs. So, it is possible that the previous renewed lock can be valid after the renewal task is disposed.\n\nBy default, the session lock renewal task will run for 5 minutes."
returns:
description: "The updated <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentCalls(int)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentCalls(int maxConcurrentCalls)"
name: "maxConcurrentCalls(int maxConcurrentCalls)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentCalls(int maxConcurrentCalls)"
summary: "Max concurrent messages that this processor should process."
parameters:
- description: "max concurrent messages that this processor should process."
name: "maxConcurrentCalls"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder maxConcurrentCalls(int maxConcurrentCalls)"
desc: "Max concurrent messages that this processor should process."
returns:
description: "The updated <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentSessions(int)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentSessions(int maxConcurrentSessions)"
name: "maxConcurrentSessions(int maxConcurrentSessions)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentSessions(int maxConcurrentSessions)"
summary: "Enables session processing roll-over by processing at most `maxConcurrentSessions`."
parameters:
- description: "Maximum number of concurrent sessions to process at any given time."
name: "maxConcurrentSessions"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder maxConcurrentSessions(int maxConcurrentSessions)"
desc: "Enables session processing roll-over by processing at most `maxConcurrentSessions`."
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.prefetchCount(int)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.prefetchCount(int prefetchCount)"
name: "prefetchCount(int prefetchCount)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.prefetchCount(int prefetchCount)"
summary: "Sets the prefetch count of the processor."
parameters:
- description: "The prefetch count."
name: "prefetchCount"
type: "<xref href=\"int?alt=int&text=int\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder prefetchCount(int prefetchCount)"
desc: "Sets the prefetch count of the processor. For both <xref uid=\"com.azure.messaging.servicebus.models.ServiceBusReceiveMode.PEEK_LOCK\" data-throw-if-not-resolved=\"false\" data-raw-source=\"PEEK_LOCK\"></xref> and <xref uid=\"com.azure.messaging.servicebus.models.ServiceBusReceiveMode.RECEIVE_AND_DELETE\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RECEIVE_AND_DELETE\"></xref> modes the default value is 0. Prefetch speeds up the message flow by aiming to have a message readily available for local retrieval when and before the application starts the processor. Setting a non-zero value will prefetch that number of messages. Setting the value to zero turns prefetch off. Using a non-zero prefetch risks of losing messages even though it has better performance."
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processError(java.util.function.Consumer<com.azure.messaging.servicebus.ServiceBusErrorContext>)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processError(Consumer<ServiceBusErrorContext> processError)"
name: "processError(Consumer<ServiceBusErrorContext> processError)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processError(Consumer<ServiceBusErrorContext> processError)"
summary: "The error handler for the processor which will be invoked in the event of an error while receiving messages."
parameters:
- description: "The error handler which will be executed when an error occurs."
name: "processError"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html\">Consumer</a><<xref href=\"com.azure.messaging.servicebus.ServiceBusErrorContext?alt=com.azure.messaging.servicebus.ServiceBusErrorContext&text=ServiceBusErrorContext\" data-throw-if-not-resolved=\"False\" />>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder processError(Consumer<ServiceBusErrorContext> processError)"
desc: "The error handler for the processor which will be invoked in the event of an error while receiving messages."
returns:
description: "The updated <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClientBuilder\"></xref> object"
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processMessage(java.util.function.Consumer<com.azure.messaging.servicebus.ServiceBusReceivedMessageContext>)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processMessage(Consumer<ServiceBusReceivedMessageContext> processMessage)"
name: "processMessage(Consumer<ServiceBusReceivedMessageContext> processMessage)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processMessage(Consumer<ServiceBusReceivedMessageContext> processMessage)"
summary: "The message processing callback for the processor that will be executed when a message is received."
parameters:
- description: "The message processing consumer that will be executed when a message is received."
name: "processMessage"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html\">Consumer</a><<xref href=\"com.azure.messaging.servicebus.ServiceBusReceivedMessageContext?alt=com.azure.messaging.servicebus.ServiceBusReceivedMessageContext&text=ServiceBusReceivedMessageContext\" data-throw-if-not-resolved=\"False\" />>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder processMessage(Consumer<ServiceBusReceivedMessageContext> processMessage)"
desc: "The message processing callback for the processor that will be executed when a message is received."
returns:
description: "The updated <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.queueName(java.lang.String)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.queueName(String queueName)"
name: "queueName(String queueName)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.queueName(String queueName)"
summary: "Sets the name of the queue to create a processor for."
parameters:
- description: "Name of the queue."
name: "queueName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder queueName(String queueName)"
desc: "Sets the name of the queue to create a processor for."
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.receiveMode(com.azure.messaging.servicebus.models.ServiceBusReceiveMode)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.receiveMode(ServiceBusReceiveMode receiveMode)"
name: "receiveMode(ServiceBusReceiveMode receiveMode)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.receiveMode(ServiceBusReceiveMode receiveMode)"
summary: "Sets the receive mode for the processor."
parameters:
- description: "Mode for receiving messages."
name: "receiveMode"
type: "<xref href=\"com.azure.messaging.servicebus.models.ServiceBusReceiveMode?alt=com.azure.messaging.servicebus.models.ServiceBusReceiveMode&text=ServiceBusReceiveMode\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder receiveMode(ServiceBusReceiveMode receiveMode)"
desc: "Sets the receive mode for the processor."
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.sessionIdleTimeout(java.time.Duration)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.sessionIdleTimeout(Duration sessionIdleTimeout)"
name: "sessionIdleTimeout(Duration sessionIdleTimeout)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.sessionIdleTimeout(Duration sessionIdleTimeout)"
summary: "Sets the maximum amount of time to wait for a message to be received for the currently active session."
parameters:
- description: "Session idle timeout."
name: "sessionIdleTimeout"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html\">Duration</a>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder sessionIdleTimeout(Duration sessionIdleTimeout)"
desc: "Sets the maximum amount of time to wait for a message to be received for the currently active session. After this time has elapsed, the processor will close the session and attempt to process another session.\n\nAfter the processor delivers a message to the <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processMessage(java.util.function.Consumer<com.azure.messaging.servicebus.ServiceBusReceivedMessageContext>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#processMessage(Consumer)\"></xref> handler, if the processor is unable to receive the next message from the session because there is no next message in the session or processing the current message takes longer than the `sessionIdleTimeout` then the session will time out. To avoid inadvertently losing sessions, choose a `sessionIdleTimeout` greater than the processing time of a message.\n\nIf not specified, the <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AmqpRetryOptions#getTryTimeout()\"></xref> will be used."
returns:
description: "The updated <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subQueue(com.azure.messaging.servicebus.models.SubQueue)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subQueue(SubQueue subQueue)"
name: "subQueue(SubQueue subQueue)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subQueue(SubQueue subQueue)"
summary: "Sets the type of the <xref uid=\"com.azure.messaging.servicebus.models.SubQueue\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SubQueue\"></xref> to connect to."
parameters:
- description: "The type of the sub queue."
name: "subQueue"
type: "<xref href=\"com.azure.messaging.servicebus.models.SubQueue?alt=com.azure.messaging.servicebus.models.SubQueue&text=SubQueue\" data-throw-if-not-resolved=\"False\" />"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder subQueue(SubQueue subQueue)"
desc: "Sets the type of the <xref uid=\"com.azure.messaging.servicebus.models.SubQueue\" data-throw-if-not-resolved=\"false\" data-raw-source=\"SubQueue\"></xref> to connect to. Azure Service Bus queues and subscriptions provide a secondary sub-queue, called a dead-letter queue (DLQ)."
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subscriptionName(java.lang.String)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subscriptionName(String subscriptionName)"
name: "subscriptionName(String subscriptionName)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subscriptionName(String subscriptionName)"
summary: "Sets the name of the subscription in the topic to listen to."
parameters:
- description: "Name of the subscription."
name: "subscriptionName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder subscriptionName(String subscriptionName)"
desc: "Sets the name of the subscription in the topic to listen to. **<xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.topicName(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#topicName(String)\"></xref> must also be set.** "
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
- uid: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.topicName(java.lang.String)"
fullName: "com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.topicName(String topicName)"
name: "topicName(String topicName)"
nameWithType: "ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.topicName(String topicName)"
summary: "Sets the name of the topic."
parameters:
- description: "Name of the topic."
name: "topicName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder topicName(String topicName)"
desc: "Sets the name of the topic. **<xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.subscriptionName(java.lang.String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#subscriptionName(String)\"></xref> must also be set.**"
returns:
description: "The modified <xref uid=\"\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusSessionProcessorClientBuilder\"></xref> object."
type: "<xref href=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder?alt=com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder&text=ServiceBusSessionProcessorClientBuilder\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Builder for creating <xref uid=\"com.azure.messaging.servicebus.ServiceBusProcessorClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClient\"></xref> to consume messages from a session-based Service Bus entity. <xref uid=\"com.azure.messaging.servicebus.ServiceBusProcessorClient\" data-throw-if-not-resolved=\"false\" data-raw-source=\"ServiceBusProcessorClient\"></xref> processes messages and errors via <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processMessage(java.util.function.Consumer<com.azure.messaging.servicebus.ServiceBusReceivedMessageContext>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#processMessage(Consumer)\"></xref> and <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processError(java.util.function.Consumer<com.azure.messaging.servicebus.ServiceBusErrorContext>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#processError(Consumer)\"></xref>. When the processor finishes processing a session, it tries to fetch the next session to process.\n\nBy default, the processor:\n\n * Automatically settles messages. Disabled via <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.disableAutoComplete()\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#disableAutoComplete()\"></xref>\n * Processes 1 session concurrently. Configured via <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentSessions(int)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#maxConcurrentSessions(int)\"></xref>\n * Invokes 1 instance of <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.processMessage(java.util.function.Consumer<com.azure.messaging.servicebus.ServiceBusReceivedMessageContext>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"processMessage consumer\"></xref>. Configured via <xref uid=\"com.azure.messaging.servicebus.ServiceBusClientBuilder.ServiceBusSessionProcessorClientBuilder.maxConcurrentCalls(int)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"#maxConcurrentCalls(int)\"></xref>\n\n**Instantiate a session-enabled processor client**\n\n```java\n// Function that gets called whenever a message is received.\n Consumer<ServiceBusReceivedMessageContext> onMessage = context -> {\n ServiceBusReceivedMessage message = context.getMessage();\n System.out.printf(\"Processing message. Session: %s, Sequence #: %s. Contents: %s%n\",\n message.getSessionId(), message.getSequenceNumber(), message.getBody());\n };\n\n Consumer<ServiceBusErrorContext> onError = context -> {\n System.out.printf(\"Error when receiving messages from namespace: '%s'. Entity: '%s'%n\",\n context.getFullyQualifiedNamespace(), context.getEntityPath());\n\n if (context.getException() instanceof ServiceBusException) {\n ServiceBusException exception = (ServiceBusException) context.getException();\n\n System.out.printf(\"Error source: %s, reason %s%n\", context.getErrorSource(),\n exception.getReason());\n } else {\n System.out.printf(\"Error occurred: %s%n\", context.getException());\n }\n };\n\n TokenCredential tokenCredential = new DefaultAzureCredentialBuilder().build();\n\n // Create the processor client via the builder and its sub-builder\n // 'fullyQualifiedNamespace' will look similar to \"{your-namespace}.servicebus.windows.net\"\n ServiceBusProcessorClient sessionProcessor = new ServiceBusClientBuilder()\n .credential(fullyQualifiedNamespace, tokenCredential)\n .sessionProcessor()\n .queueName(sessionEnabledQueueName)\n .receiveMode(ServiceBusReceiveMode.PEEK_LOCK)\n .disableAutoComplete()\n .maxConcurrentSessions(2)\n .processMessage(onMessage)\n .processError(onError)\n .buildProcessorClient();\n\n // Starts the processor in the background. Control returns immediately.\n sessionProcessor.start();\n\n // Stop processor and dispose when done processing messages.\n sessionProcessor.stop();\n sessionProcessor.close();\n```"
metadata: {}
package: "com.azure.messaging.servicebus"
artifact: com.azure:azure-messaging-servicebus:7.17.1