pubsub

package
v1.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

Kubemq pubsub target Connector

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

Prerequisites

The following required to run the gcp-pubsub target connector:

  • kubemq cluster
  • gcp-pubsub set up
  • kubemq-targets deployment

Configuration

pubsub target connector configuration properties:

Properties Key Required Description Example
project_id yes gcp firestore project_id "/myproject"
credentials yes gcp credentials files "<google json credentials"
retries no number of sending retires retries number

Example:

bindings:
  - name: kubemq-query-gcp-pubsub
    source:
      kind: kubemq.query
      name: kubemq-query
      properties:
        address: "kubemq-cluster:50000"
        client_id: "kubemq-query-gcp-pubsub-connector"
        auth_token: ""
        channel: "query.gcp.pubsub"
        group:   ""
        auto_reconnect: "true"
        reconnect_interval_seconds: "1"
        max_reconnects: "0"
    target:
      kind: gcp.pubsub
      name: gcp-pubsub
      properties:
        project_id: "projectID"
        retries:    "0"
        credentials: 'json'

Usage

Send Message

send a message to pub sub

Send Message metadata setting:

Metadata Key Required Description Possible values
topicID yes the name of the topicID to sent to valid topicID
tags no type of method key value string

Example with tags:

{
  "metadata": {
    "topic_id": "my_topic",
    "tags": "{\"tag-1\":\"test\",\"tag-2\":\"test2\"}"
  },
  "data": "c3RyaW5n"
}

Example without tags:

{
  "metadata": {
    "topic_id": "my_topic"
  },
  "data": "c3RyaW5n"
}

Documentation

Index

Constants

View Source
const (
	DefaultRetries = 0
)

Variables

This section is empty.

Functions

func Connector

func Connector() *common.Connector

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Connector

func (c *Client) Connector() *common.Connector

func (*Client) Do

func (c *Client) Do(ctx context.Context, request *types.Request) (*types.Response, error)

func (*Client) Init

func (c *Client) Init(ctx context.Context, cfg config.Spec, log *logger.Logger) error

func (*Client) Stop

func (c *Client) Stop() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL