-
Notifications
You must be signed in to change notification settings - Fork 165
/
QueueComponentConfiguration.java
313 lines (274 loc) · 11.3 KB
/
QueueComponentConfiguration.java
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.azure.storage.queue.springboot;
import java.time.Duration;
import com.azure.storage.common.StorageSharedKeyCredential;
import com.azure.storage.queue.QueueServiceClient;
import org.apache.camel.component.azure.storage.queue.CredentialType;
import org.apache.camel.component.azure.storage.queue.QueueComponent;
import org.apache.camel.component.azure.storage.queue.QueueConfiguration;
import org.apache.camel.component.azure.storage.queue.QueueOperationDefinition;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Stores and retrieves messages to/from Azure Storage Queue.
*
* Generated by camel-package-maven-plugin - do not edit this file!
*/
@ConfigurationProperties(prefix = "camel.component.azure-storage-queue")
public class QueueComponentConfiguration
extends
ComponentConfigurationPropertiesCommon {
/**
* Whether to enable auto configuration of the azure-storage-queue
* component. This is enabled by default.
*/
private Boolean enabled;
/**
* The component configurations. The option is a
* org.apache.camel.component.azure.storage.queue.QueueConfiguration type.
*/
private QueueConfiguration configuration;
/**
* Determines the credential strategy to adopt
*/
private CredentialType credentialType = CredentialType.SHARED_ACCOUNT_KEY;
/**
* Service client to a storage account to interact with the queue service.
* This client does not hold any state about a particular storage account
* but is instead a convenient way of sending off appropriate requests to
* the resource on the service. This client contains all the operations for
* interacting with a queue account in Azure Storage. Operations allowed by
* the client are creating, listing, and deleting queues, retrieving and
* updating properties of the account, and retrieving statistics of the
* account. The option is a com.azure.storage.queue.QueueServiceClient type.
*/
private QueueServiceClient serviceClient;
/**
* Allows for bridging the consumer to the Camel routing Error Handler,
* which mean any exceptions (if possible) occurred while the Camel consumer
* is trying to pickup incoming messages, or the likes, will now be
* processed as a message and handled by the routing Error Handler.
* Important: This is only possible if the 3rd party component allows Camel
* to be alerted if an exception was thrown. Some components handle this
* internally only, and therefore bridgeErrorHandler is not possible. In
* other situations we may improve the Camel component to hook into the 3rd
* party component and make this possible for future releases. By default
* the consumer will use the org.apache.camel.spi.ExceptionHandler to deal
* with exceptions, that will be logged at WARN or ERROR level and ignored.
*/
private Boolean bridgeErrorHandler = false;
/**
* When is set to true, the queue will be automatically created when sending
* messages to the queue.
*/
private Boolean createQueue = false;
/**
* Whether the producer should be started lazy (on the first message). By
* starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during starting
* and cause the route to fail being started. By deferring this startup to
* be lazy then the startup failure can be handled during routing messages
* via Camel's routing error handlers. Beware that when the first message is
* processed then creating and starting the producer may take a little time
* and prolong the total processing time of the processing.
*/
private Boolean lazyStartProducer = false;
/**
* Queue service operation hint to the producer
*/
private QueueOperationDefinition operation;
/**
* Whether autowiring is enabled. This is used for automatic autowiring
* options (the option must be marked as autowired) by looking up in the
* registry to find if there is a single instance of matching type, which
* then gets configured on the component. This can be used for automatic
* configuring JDBC data sources, JMS connection factories, AWS Clients,
* etc.
*/
private Boolean autowiredEnabled = true;
/**
* Used for enabling or disabling all consumer based health checks from this
* component
*/
private Boolean healthCheckConsumerEnabled = true;
/**
* Used for enabling or disabling all producer based health checks from this
* component. Notice: Camel has by default disabled all producer based
* health-checks. You can turn on producer checks globally by setting
* camel.health.producersEnabled=true.
*/
private Boolean healthCheckProducerEnabled = true;
/**
* Maximum number of messages to get, if there are less messages exist in
* the queue than requested all the messages will be returned. If left empty
* only 1 message will be retrieved, the allowed range is 1 to 32 messages.
*/
private Integer maxMessages = 1;
/**
* The ID of the message to be deleted or updated.
*/
private String messageId;
/**
* Unique identifier that must match for the message to be deleted or
* updated.
*/
private String popReceipt;
/**
* An optional timeout applied to the operation. If a response is not
* returned before the timeout concludes a RuntimeException will be thrown.
*/
private Duration timeout;
/**
* How long the message will stay alive in the queue. If unset the value
* will default to 7 days, if -1 is passed the message will not expire. The
* time to live must be -1 or any positive number. The format should be in
* this form: PnDTnHnMn.nS., e.g: PT20.345S -- parses as 20.345 seconds, P2D
* -- parses as 2 days However, in case you are using
* EndpointDsl/ComponentDsl, you can do something like Duration.ofSeconds()
* since these Java APIs are typesafe.
*/
private Duration timeToLive;
/**
* The timeout period for how long the message is invisible in the queue.
* The timeout must be between 1 seconds and 7 days. The format should be in
* this form: PnDTnHnMn.nS., e.g: PT20.345S -- parses as 20.345 seconds, P2D
* -- parses as 2 days However, in case you are using
* EndpointDsl/ComponentDsl, you can do something like Duration.ofSeconds()
* since these Java APIs are typesafe.
*/
private Duration visibilityTimeout;
/**
* Access key for the associated azure account name to be used for
* authentication with azure queue services
*/
private String accessKey;
/**
* StorageSharedKeyCredential can be injected to create the azure client,
* this holds the important authentication information. The option is a
* com.azure.storage.common.StorageSharedKeyCredential type.
*/
private StorageSharedKeyCredential credentials;
public QueueConfiguration getConfiguration() {
return configuration;
}
public void setConfiguration(QueueConfiguration configuration) {
this.configuration = configuration;
}
public CredentialType getCredentialType() {
return credentialType;
}
public void setCredentialType(CredentialType credentialType) {
this.credentialType = credentialType;
}
public QueueServiceClient getServiceClient() {
return serviceClient;
}
public void setServiceClient(QueueServiceClient serviceClient) {
this.serviceClient = serviceClient;
}
public Boolean getBridgeErrorHandler() {
return bridgeErrorHandler;
}
public void setBridgeErrorHandler(Boolean bridgeErrorHandler) {
this.bridgeErrorHandler = bridgeErrorHandler;
}
public Boolean getCreateQueue() {
return createQueue;
}
public void setCreateQueue(Boolean createQueue) {
this.createQueue = createQueue;
}
public Boolean getLazyStartProducer() {
return lazyStartProducer;
}
public void setLazyStartProducer(Boolean lazyStartProducer) {
this.lazyStartProducer = lazyStartProducer;
}
public QueueOperationDefinition getOperation() {
return operation;
}
public void setOperation(QueueOperationDefinition operation) {
this.operation = operation;
}
public Boolean getAutowiredEnabled() {
return autowiredEnabled;
}
public void setAutowiredEnabled(Boolean autowiredEnabled) {
this.autowiredEnabled = autowiredEnabled;
}
public Boolean getHealthCheckConsumerEnabled() {
return healthCheckConsumerEnabled;
}
public void setHealthCheckConsumerEnabled(Boolean healthCheckConsumerEnabled) {
this.healthCheckConsumerEnabled = healthCheckConsumerEnabled;
}
public Boolean getHealthCheckProducerEnabled() {
return healthCheckProducerEnabled;
}
public void setHealthCheckProducerEnabled(Boolean healthCheckProducerEnabled) {
this.healthCheckProducerEnabled = healthCheckProducerEnabled;
}
public Integer getMaxMessages() {
return maxMessages;
}
public void setMaxMessages(Integer maxMessages) {
this.maxMessages = maxMessages;
}
public String getMessageId() {
return messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public String getPopReceipt() {
return popReceipt;
}
public void setPopReceipt(String popReceipt) {
this.popReceipt = popReceipt;
}
public Duration getTimeout() {
return timeout;
}
public void setTimeout(Duration timeout) {
this.timeout = timeout;
}
public Duration getTimeToLive() {
return timeToLive;
}
public void setTimeToLive(Duration timeToLive) {
this.timeToLive = timeToLive;
}
public Duration getVisibilityTimeout() {
return visibilityTimeout;
}
public void setVisibilityTimeout(Duration visibilityTimeout) {
this.visibilityTimeout = visibilityTimeout;
}
public String getAccessKey() {
return accessKey;
}
public void setAccessKey(String accessKey) {
this.accessKey = accessKey;
}
public StorageSharedKeyCredential getCredentials() {
return credentials;
}
public void setCredentials(StorageSharedKeyCredential credentials) {
this.credentials = credentials;
}
}