Spanner
Kubemq gcp-spanner target connector allows services using kubemq server to access google spanner server.

Prerequisites

The following are required to run the gcp-spanner target connector:
  • kubemq cluster
  • gcp-spanner set up
  • kubemq-source deployment

Configuration

spanner target connector configuration properties:
Properties Key
Required
Description
Example
db
yes
gcp spanner db name
"/mydb" should conform to pattern "^projects/(?P+)/instances/(?P+)/databases/(?P+)quot;
credentials
yes
gcp credentials files
"<google json credentials"
Example:
1
bindings:
2
- name: kubemq-query-gcp-spanner
3
source:
4
kind: kubemq.query
5
name: kubemq-query
6
properties:
7
address: "kubemq-cluster:50000"
8
client_id: "kubemq-query-gcp-spanner-connector"
9
auth_token: ""
10
channel: "query.gcp.spanner"
11
group: ""
12
auto_reconnect: "true"
13
reconnect_interval_seconds: "1"
14
max_reconnects: "0"
15
target:
16
kind: gcp.spanner
17
name: target-gcp-spanner
18
properties:
19
db: "id"
20
credentials: 'json'
Copied!

Usage

Query Request

create query request.
Query metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"query"
query
yes
the query body
"select * from table"
Example:
1
{
2
"metadata": {
3
"method": "query",
4
"query": "select * from table"
5
},
6
"data": null
7
}
Copied!

Read Table Request by columns

read table by table_name
Read Table metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"read"
table_name
yes
table name to read from
""
Example:
1
{
2
"metadata": {
3
"method": "read",
4
"table_name": "<myTable>"
5
},
6
"data": "W1wiaWRcIixcIm5hbWVcIl0="
7
}
Copied!

Insert Or Update Table

insert or update a table
Insert Or Update metadata setting:
Metadata Key
Required
Description
Possible values
method
yes
type of method
"insert","update","insert_or_update"
Example:
1
{
2
"metadata": {
3
"method": "insert_or_update"
4
},
5
"data": "W3tcInRhYmxlX25hbWVcIjpcInRlc3QyXCIsXCJjb2x1bW5fbmFtZXNcIjpbXCJpZFwiLFwibmFtZVwiXSxcImNvbHVtbl92YWx1ZXNcIjpbMTcsXCJuYW1lMVwiXSxcImNvbHVtbl90eXBlXCI6W1wiSU5UNjRcIixcIlNUUklOR1wiXX0se1widGFibGVfbmFtZVwiOlwidGVzdDJcIixcImNvbHVtbl9uYW1lc1wiOltcImlkXCIsXCJuYW1lXCJdLFwiY29sdW1uX3ZhbHVlc1wiOlsxOCxcIm5hbWUyXCJdLFwiY29sdW1uX3R5cGVcIjpbXCJJTlQ2NFwiLFwiU1RSSU5HXCJdfV0="
6
}
Copied!
Last modified 11mo ago