Files
Kubemq files target connector allows services using kubemq server to access files messaging services.

Prerequisites

The following are required to run the files target connector:
  • kubemq cluster
  • Azure active storage account
  • Azure active with storage enable - with access account
  • kubemq-targets deployment

Configuration

files target connector configuration properties:
Properties Key
Required
Description
Example
storage_account
yes
azure storage account name
"my_account"
storage_access_key
yes
azure storage access key
"abcd1234"
policy
no
exponential or linear
"retry_policy_exponential",default(retry_policy_exponential)
max_tries
no
request max tries (1 disable)
"1",default(1)
try_timeout
no
Maximum time allowed for any single try
"3000",default(10000) milliseconds
retry_delay
no
Backoff amount for each retry
"1000",default(600) milliseconds
max_retry_delay
no
delay between retries
"1000",default(1800) milliseconds
Example:
1
bindings:
2
- name: kubemq-query-azure-files
3
source:
4
kind: kubemq.query
5
name: kubemq-query
6
properties:
7
address: "kubemq-cluster:50000"
8
client_id: "kubemq-query-azure-files-connector"
9
auth_token: ""
10
channel: "azure.storage.files"
11
group: ""
12
concurrency: "1"
13
auto_reconnect: "true"
14
reconnect_interval_seconds: "1"
15
max_reconnects: "0"
16
target:
17
kind: azure.storage.files
18
name: azure-storage-files
19
properties:
20
storage_account: "id"
21
storage_access_key: "key"
Copied!

Usage

Create

Create metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"create"
service_url
yes
service url path and filename
size
no
max file size
"2000",default(1000000)
1
{
2
"metadata": {
3
"method": "create",
4
"service_url": "https://test.end.point.test.net/test/test.txt"
5
},
6
"data": "bXktZmlsZS1kYXRh"
7
}
Copied!

Upload

Upload metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"upload"
service_url
yes
service url path and filename
data
yes
file data (byte array)
"bXktZmlsZS1kYXRh"
range_size
no
specifies the range size to use in bytes
"0" ,default(4194304)
parallelism
no
maximum number of ranges to upload in parallel
"upload",default(0)
file_metadata
no
key value string string file Metadata
"{"tag":"test","name":"myname"}",default(none)
Example:
1
{
2
"metadata": {
3
"method": "upload",
4
"service_url": "https://test.end.point.test.net/test/test.txt"
5
},
6
"data": "bXktZmlsZS1kYXRh"
7
}
Copied!

Get

Get metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"get"
service_url
yes
service url path and filename
max_retry_request
no
max retry count
"20" (default "1")
count
no
number of files to get
"20" (will get all from offset)
offset
no
start reading files from offset
"20" (will start from the first byte in files)
Example:
1
{
2
"metadata": {
3
"method": "get",
4
"service_url": "https://test.end.point.test.net/test/test.txt"
5
},
6
"data": null
7
}
Copied!

Delete

Delete metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"delete"
file_name
yes
the name of the file to delete
"myfile.txt"
service_url
yes
service url path and filename
Example:
1
{
2
"metadata": {
3
"method": "delete",
4
"service_url": "https://test.end.point.test.net/test"
5
},
6
"data": null
7
}
Copied!
Last modified 11mo ago