From 5de627d31e77f223c3468c4c112465ed79184073 Mon Sep 17 00:00:00 2001 From: rohit-gohri Date: Fri, 13 Sep 2024 08:46:07 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20delivery?= =?UTF-8?q?hero/hfc-pubsub@aa6ea15b68c162ec775bd420ee1a5c62da0190a4=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 4 ++-- __docusaurus/debug/config/index.html | 4 ++-- __docusaurus/debug/content/index.html | 4 ++-- __docusaurus/debug/globalData/index.html | 4 ++-- __docusaurus/debug/index.html | 4 ++-- __docusaurus/debug/metadata/index.html | 4 ++-- __docusaurus/debug/registry/index.html | 4 ++-- __docusaurus/debug/routes/index.html | 4 ++-- api/classes/Message/index.html | 8 ++++---- api/classes/PubSubService/index.html | 6 +++--- api/classes/SubscriptionService/index.html | 10 +++++----- api/classes/Topic/index.html | 8 ++++---- api/index.html | 6 +++--- api/interfaces/Payload/index.html | 6 +++--- api/interfaces/SubscriberMetadata/index.html | 8 ++++---- api/interfaces/SubscriberObject/index.html | 6 +++--- api/interfaces/SubscriberOptions/index.html | 10 +++++----- api/interfaces/TopicOptions/index.html | 6 +++--- .../js/{13caf63c.dc040e5e.js => 13caf63c.6a54c260.js} | 2 +- assets/js/157e1c0d.a8c504ea.js | 1 - assets/js/157e1c0d.df0a2536.js | 1 + .../js/{1c01e663.47aa78b7.js => 1c01e663.02b0d49e.js} | 2 +- assets/js/246f2c6f.d65c1318.js | 1 + assets/js/246f2c6f.d8eef432.js | 1 - assets/js/24bb654f.1cfb78d3.js | 1 - assets/js/24bb654f.e76d3000.js | 1 + .../js/{5e8c322a.6ea76047.js => 5e8c322a.39808287.js} | 2 +- .../js/{5f9e1e26.c9875a14.js => 5f9e1e26.39d5b5a3.js} | 2 +- .../js/{6401c6ac.3ff4cca2.js => 6401c6ac.bf35ce5c.js} | 2 +- .../js/{a8bbf00a.f5eed127.js => a8bbf00a.330c4b11.js} | 2 +- assets/js/bf56a78d.04f6a55e.js | 1 + assets/js/bf56a78d.33a88792.js | 1 - assets/js/f0debbde.5593c65f.js | 1 + assets/js/f0debbde.d89388d9.js | 1 - ...ntime~main.76eba56e.js => runtime~main.cd29fe83.js} | 2 +- changelog/index.html | 4 ++-- getting-started/installation/index.html | 4 ++-- guides/cli/index.html | 4 ++-- guides/drivers/index.html | 4 ++-- guides/migrating-to-v2/index.html | 4 ++-- guides/testing/index.html | 4 ++-- index.html | 4 ++-- options/index.html | 4 ++-- publishing/attributes/index.html | 4 ++-- publishing/publish-diff-project/index.html | 4 ++-- publishing/retry-settings/index.html | 4 ++-- publishing/topics/index.html | 4 ++-- server/connect-database/index.html | 4 ++-- server/custom-logger/index.html | 4 ++-- server/graceful-shutdown/index.html | 4 ++-- server/health-check/index.html | 4 ++-- server/service/index.html | 4 ++-- subscribing/Messages_compression/index.html | 4 ++-- subscribing/dead-letter-policy/index.html | 4 ++-- subscribing/error-handling/index.html | 4 ++-- subscribing/labels/index.html | 4 ++-- subscribing/message-ordering/index.html | 4 ++-- subscribing/retry-policy/index.html | 4 ++-- subscribing/subscriptions/index.html | 4 ++-- v1/api/classes/Message/index.html | 4 ++-- v1/api/classes/PubSubService/index.html | 4 ++-- v1/api/classes/Subscriber/index.html | 4 ++-- v1/api/classes/SubscriptionService/index.html | 4 ++-- v1/api/classes/Topic/index.html | 4 ++-- v1/api/index.html | 4 ++-- .../interfaces/Interfaces.BackoffSettings/index.html | 4 ++-- .../Interfaces.GooglePubSubProject/index.html | 4 ++-- v1/api/interfaces/Interfaces.PublishOptions/index.html | 4 ++-- v1/api/interfaces/Interfaces.RetryConfig/index.html | 4 ++-- .../Interfaces.TopicPublishOptions/index.html | 4 ++-- v1/api/interfaces/Interfaces.pubSubClient/index.html | 4 ++-- v1/api/interfaces/Payload/index.html | 4 ++-- v1/api/interfaces/SubscriberOptions/index.html | 4 ++-- v1/api/namespaces/Interfaces/index.html | 4 ++-- v1/cli/index.html | 4 ++-- v1/drivers/index.html | 4 ++-- v1/getting-started/installation/index.html | 4 ++-- v1/guides/testing/index.html | 4 ++-- v1/index.html | 4 ++-- v1/options/index.html | 4 ++-- v1/publishing/attributes/index.html | 4 ++-- v1/publishing/publish-diff-project/index.html | 4 ++-- v1/publishing/retry-settings/index.html | 4 ++-- v1/publishing/topics/index.html | 4 ++-- v1/server/connect-database/index.html | 4 ++-- v1/server/custom-logger/index.html | 4 ++-- v1/server/graceful-shutdown/index.html | 4 ++-- v1/server/health-check/index.html | 4 ++-- v1/server/service/index.html | 4 ++-- v1/subscribing/dead-letter-policy/index.html | 4 ++-- v1/subscribing/error-handling/index.html | 4 ++-- v1/subscribing/message-ordering/index.html | 4 ++-- v1/subscribing/retry-policy/index.html | 4 ++-- v1/subscribing/subscriptions/index.html | 4 ++-- 94 files changed, 183 insertions(+), 183 deletions(-) rename assets/js/{13caf63c.dc040e5e.js => 13caf63c.6a54c260.js} (93%) delete mode 100644 assets/js/157e1c0d.a8c504ea.js create mode 100644 assets/js/157e1c0d.df0a2536.js rename assets/js/{1c01e663.47aa78b7.js => 1c01e663.02b0d49e.js} (96%) create mode 100644 assets/js/246f2c6f.d65c1318.js delete mode 100644 assets/js/246f2c6f.d8eef432.js delete mode 100644 assets/js/24bb654f.1cfb78d3.js create mode 100644 assets/js/24bb654f.e76d3000.js rename assets/js/{5e8c322a.6ea76047.js => 5e8c322a.39808287.js} (76%) rename assets/js/{5f9e1e26.c9875a14.js => 5f9e1e26.39d5b5a3.js} (90%) rename assets/js/{6401c6ac.3ff4cca2.js => 6401c6ac.bf35ce5c.js} (51%) rename assets/js/{a8bbf00a.f5eed127.js => a8bbf00a.330c4b11.js} (94%) create mode 100644 assets/js/bf56a78d.04f6a55e.js delete mode 100644 assets/js/bf56a78d.33a88792.js create mode 100644 assets/js/f0debbde.5593c65f.js delete mode 100644 assets/js/f0debbde.d89388d9.js rename assets/js/{runtime~main.76eba56e.js => runtime~main.cd29fe83.js} (92%) diff --git a/404.html b/404.html index f3e54660..8d57a817 100644 --- a/404.html +++ b/404.html @@ -6,13 +6,13 @@ Page Not Found | Pub/Sub Node.js Framework - +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/__docusaurus/debug/config/index.html b/__docusaurus/debug/config/index.html index 66000a9a..67ac19ec 100644 --- a/__docusaurus/debug/config/index.html +++ b/__docusaurus/debug/config/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Site config

- + \ No newline at end of file diff --git a/__docusaurus/debug/content/index.html b/__docusaurus/debug/content/index.html index 45d92320..2d7c9af4 100644 --- a/__docusaurus/debug/content/index.html +++ b/__docusaurus/debug/content/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Plugin content

docusaurus-plugin-content-docs

default
- + \ No newline at end of file diff --git a/__docusaurus/debug/globalData/index.html b/__docusaurus/debug/globalData/index.html index e0d1e853..5d74c872 100644 --- a/__docusaurus/debug/globalData/index.html +++ b/__docusaurus/debug/globalData/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Global data

- + \ No newline at end of file diff --git a/__docusaurus/debug/index.html b/__docusaurus/debug/index.html index cf494aef..c8d24b7b 100644 --- a/__docusaurus/debug/index.html +++ b/__docusaurus/debug/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Site config

- + \ No newline at end of file diff --git a/__docusaurus/debug/metadata/index.html b/__docusaurus/debug/metadata/index.html index ffbe6759..9e6aebc1 100644 --- a/__docusaurus/debug/metadata/index.html +++ b/__docusaurus/debug/metadata/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Site Metadata

Docusaurus Version: 2.0.0-beta.ff31de0ff
Site Version: 2.2.2

Plugins and themes

  • 2.0.0-beta.ff31de0ff
    docusaurus-plugin-content-docs
    Type: package
  • 2.0.0-beta.ff31de0ff
    docusaurus-plugin-content-blog
    Type: package
  • 2.0.0-beta.ff31de0ff
    docusaurus-plugin-content-pages
    Type: package
  • 2.0.0-beta.ff31de0ff
    docusaurus-plugin-debug
    Type: package
  • 2.0.0-beta.ff31de0ff
    docusaurus-plugin-sitemap
    Type: package
  • 2.0.0-beta.ff31de0ff
    docusaurus-theme-classic
    Type: package
  • 0.16.3
    undefined
    Type: package
- + \ No newline at end of file diff --git a/__docusaurus/debug/registry/index.html b/__docusaurus/debug/registry/index.html index dc160cc4..911c3c01 100644 --- a/__docusaurus/debug/registry/index.html +++ b/__docusaurus/debug/registry/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Registry

  • Aliased Path: @theme/DocItem
    Resolved Path: 4651
  • Aliased Path: @site/versioned_docs/version-v1/Drivers.md
    Resolved Path: 6804
  • Aliased Path: @site/versioned_docs/version-v1/api/classes/Topic.md
    Resolved Path: 1250
  • Aliased Path: @site/docs/publishing/Topics.md
    Resolved Path: 1773
  • Aliased Path: @site/docs/subscribing/Retry Policy.md
    Resolved Path: 3937
  • Aliased Path: @site/versioned_docs/version-v1/api/classes/Subscriber.md
    Resolved Path: 9804
  • Aliased Path: @site/docs/subscribing/Message Ordering.md
    Resolved Path: 3195
  • Aliased Path: @site/docs/api/interfaces/SubscriberOptions.md
    Resolved Path: 8582
  • Aliased Path: @site/versioned_docs/version-v1/publishing/Retry Settings.md
    Resolved Path: 7979
  • Aliased Path: @site/docs/api/interfaces/TopicOptions.md
    Resolved Path: 7588
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Interfaces.BackoffSettings.md
    Resolved Path: 1449
  • Aliased Path: @site/versioned_docs/version-v1/publishing/Publish Diff Project.md
    Resolved Path: 8262
  • Aliased Path: @theme/DocPage
    Resolved Path: 4661
  • Aliased Path: @site/docs/api/interfaces/Payload.md
    Resolved Path: 9098
  • Aliased Path: @site/docs/server/Custom Logger.md
    Resolved Path: 5884
  • Aliased Path: @theme/DebugConfig
    Resolved Path: 1718
  • Aliased Path: ~debug/default/docusaurus-debug-all-content-673.json
    Resolved Path: 6267
  • Aliased Path: @site/docs/api/classes/SubscriptionService.md
    Resolved Path: 4033
  • Aliased Path: @site/versioned_docs/version-v1/server/Custom Logger.md
    Resolved Path: 292
  • Aliased Path: @site/docs/publishing/Retry Settings.md
    Resolved Path: 5254
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Interfaces.GooglePubSubProject.md
    Resolved Path: 5730
  • Aliased Path: @site/docs/guides/Drivers.md
    Resolved Path: 9790
  • Aliased Path: @site/versioned_docs/version-v1/server/Connect Database.md
    Resolved Path: 9292
  • Aliased Path: @site/versioned_docs/version-v1/subscribing/Dead Letter Policy.md
    Resolved Path: 6732
  • Aliased Path: @site/docs/subscribing/Internal Error Handling.md
    Resolved Path: 3801
  • Aliased Path: @site/versioned_docs/version-v1/guides/Testing.md
    Resolved Path: 5184
  • Aliased Path: @site/docs/api/index.md
    Resolved Path: 3372
  • Aliased Path: @site/docs/api/classes/PubSubService.md
    Resolved Path: 8382
  • Aliased Path: @site/versioned_docs/version-v1/server/Health Check.md
    Resolved Path: 3002
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/SubscriberOptions.md
    Resolved Path: 5209
  • Aliased Path: @site/docs/api/classes/Topic.md
    Resolved Path: 6586
  • Aliased Path: @theme/DebugRegistry
    Resolved Path: 4430
  • Aliased Path: @site/docs/publishing/Attributes.md
    Resolved Path: 6837
  • Aliased Path: @theme/DebugSiteMetadata
    Resolved Path: 9424
  • Aliased Path: @site/docs/subscribing/Dead Letter Policy.md
    Resolved Path: 9489
  • Aliased Path: @site/versioned_docs/version-v1/api/namespaces/Interfaces.md
    Resolved Path: 5066
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Interfaces.pubSubClient.md
    Resolved Path: 9304
  • Aliased Path: @site/versioned_docs/version-v1/api/index.md
    Resolved Path: 6818
  • Aliased Path: @site/docs/Options.md
    Resolved Path: 5902
  • Aliased Path: @site/versioned_docs/version-v1/api/classes/Message.md
    Resolved Path: 3500
  • Aliased Path: @site/versioned_docs/version-v1/server/Graceful Shutdown.md
    Resolved Path: 2601
  • Aliased Path: @site/versioned_docs/version-v1/subscribing/Message Ordering.md
    Resolved Path: 2393
  • Aliased Path: @site/docs/subscribing/Messages Compression.md
    Resolved Path: 7544
  • Aliased Path: @site/docs/subscribing/Labels.md
    Resolved Path: 2537
  • Aliased Path: @site/versioned_docs/version-v1/CLI.md
    Resolved Path: 5386
  • Aliased Path: @site/versioned_docs/version-v1/api/classes/SubscriptionService.md
    Resolved Path: 3939
  • Aliased Path: ~docs/default/version-current-metadata-prop-751.json
    Resolved Path: 1109
  • Aliased Path: @theme/DebugRoutes
    Resolved Path: 2383
  • Aliased Path: @site/docs/publishing/Publish Diff Project.md
    Resolved Path: 7571
  • Aliased Path: @site/versioned_docs/version-v1/subscribing/Subscriptions.md
    Resolved Path: 2884
  • Aliased Path: @site/docs/changelog.md
    Resolved Path: 7156
  • Aliased Path: @site/versioned_docs/version-v1/publishing/Attributes.md
    Resolved Path: 6792
  • Aliased Path: @site/docs/api/classes/Message.md
    Resolved Path: 9280
  • Aliased Path: @site/versioned_docs/version-v1/subscribing/Retry Policy.md
    Resolved Path: 747
  • Aliased Path: @site/docs/guides/Migrating to v2.mdx
    Resolved Path: 755
  • Aliased Path: @theme/DebugContent
    Resolved Path: 4709
  • Aliased Path: @site/docs/guides/CLI.md
    Resolved Path: 7194
  • Aliased Path: @site/docs/api/interfaces/SubscriberObject.md
    Resolved Path: 3478
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Interfaces.PublishOptions.md
    Resolved Path: 2155
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Payload.md
    Resolved Path: 2303
  • Aliased Path: @site/versioned_docs/version-v1/Options.md
    Resolved Path: 2888
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Interfaces.RetryConfig.md
    Resolved Path: 9159
  • Aliased Path: @site/versioned_docs/version-v1/api/classes/PubSubService.md
    Resolved Path: 4130
  • Aliased Path: @site/versioned_docs/version-v1/getting-started/Installation.md
    Resolved Path: 3398
  • Aliased Path: @site/docs/server/Health Check.md
    Resolved Path: 4980
  • Aliased Path: @site/versioned_docs/version-v1/subscribing/Internal Error Handling.md
    Resolved Path: 3124
  • Aliased Path: @site/versioned_docs/version-v1/Introduction.md
    Resolved Path: 5652
  • Aliased Path: @site/docs/server/Graceful Shutdown.md
    Resolved Path: 224
  • Aliased Path: @site/versioned_docs/version-v1/publishing/Topics.md
    Resolved Path: 1791
  • Aliased Path: @site/versioned_docs/version-v1/server/Service.md
    Resolved Path: 8028
  • Aliased Path: @site/docs/Introduction.md
    Resolved Path: 938
  • Aliased Path: ~docs/default/version-v-1-metadata-prop-085.json
    Resolved Path: 319
  • Aliased Path: @site/docs/server/Connect Database.md
    Resolved Path: 2407
  • Aliased Path: @site/docs/subscribing/Subscriptions.md
    Resolved Path: 5885
  • Aliased Path: @site/docs/getting-started/Installation.md
    Resolved Path: 1731
  • Aliased Path: @site/docs/server/Service.md
    Resolved Path: 754
  • Aliased Path: @theme/DebugGlobalData
    Resolved Path: 9205
  • Aliased Path: @site/docs/api/interfaces/SubscriberMetadata.md
    Resolved Path: 9227
  • Aliased Path: @site/docs/guides/Testing.md
    Resolved Path: 7201
  • Aliased Path: @site/versioned_docs/version-v1/api/interfaces/Interfaces.TopicPublishOptions.md
    Resolved Path: 966
- + \ No newline at end of file diff --git a/__docusaurus/debug/routes/index.html b/__docusaurus/debug/routes/index.html index e5d9db20..ecd0a589 100644 --- a/__docusaurus/debug/routes/index.html +++ b/__docusaurus/debug/routes/index.html @@ -6,13 +6,13 @@ Docusaurus debug panel - +

Routes

  • /hfc-pubsub/__docusaurus/debug
    Is exact: true
  • /hfc-pubsub/__docusaurus/debug/config
    Is exact: true
  • /hfc-pubsub/__docusaurus/debug/content
    Is exact: true
  • /hfc-pubsub/__docusaurus/debug/globalData
    Is exact: true
  • /hfc-pubsub/__docusaurus/debug/metadata
    Is exact: true
  • /hfc-pubsub/__docusaurus/debug/registry
    Is exact: true
  • /hfc-pubsub/__docusaurus/debug/routes
    Is exact: true
  • /hfc-pubsub/v1
    Is exact: false
    Child Routes:
  • /hfc-pubsub/
    Is exact: false
    Child Routes:
  • *
    Is exact: false
- + \ No newline at end of file diff --git a/api/classes/Message/index.html b/api/classes/Message/index.html index ea2b54e9..2d864aaa 100644 --- a/api/classes/Message/index.html +++ b/api/classes/Message/index.html @@ -6,14 +6,14 @@ Class: Message<T> | Pub/Sub Node.js Framework - +
-
Skip to main content
Version: v2

Class: Message<T>

Type parameters#

NameType
Tunknown

Constructors#

constructor#

new Message<T>()

Type parameters#

NameType
Tunknown

Properties#

data#

data: Buffer

Defined in#

src/message/index.ts:6


gCloudMessage#

Optional gCloudMessage: Message

Defined in#

src/message/index.ts:7

Methods#

ack#

ack(): void

Returns#

void

Defined in#

src/message/index.ts:39


decompress#

decompress(): Buffer

Returns#

Buffer

Defined in#

src/message/index.ts:57


modAck#

modAck(deadline): void

Parameters#

NameType
deadlinenumber

Returns#

void

Defined in#

src/message/index.ts:45


nack#

nack(): void

Returns#

void

Defined in#

src/message/index.ts:51


toJSON#

toJSON(): T

Returns#

T

Defined in#

src/message/index.ts:31


from#

Static from<M>(message): Message<M>

Builds a new message object in the synchronous driver. -Used by the eventBus.

Type parameters#

Name
M

Parameters#

NameTypeDescription
messageMany message that can be buffered

Returns#

Message<M>

Defined in#

src/message/index.ts:14


fromGCloud#

Static fromGCloud(message): Message<unknown>

Builds a message for Google Cloud Driver

Parameters#

NameTypeDescription
messageMessageA valid Google Cloud message

Returns#

Message<unknown>

Defined in#

src/message/index.ts:24

- +
Skip to main content
Version: v2

Class: Message<T>

Type parameters#

NameType
Tunknown

Constructors#

constructor#

new Message<T>()

Type parameters#

NameType
Tunknown

Properties#

data#

data: Buffer

Defined in#

src/message/index.ts:6


gCloudMessage#

Optional gCloudMessage: Message

Defined in#

src/message/index.ts:7

Methods#

ack#

ack(): void

Returns#

void

Defined in#

src/message/index.ts:39


decompress#

decompress(): Buffer

Returns#

Buffer

Defined in#

src/message/index.ts:57


modAck#

modAck(deadline): void

Parameters#

NameType
deadlinenumber

Returns#

void

Defined in#

src/message/index.ts:45


nack#

nack(): void

Returns#

void

Defined in#

src/message/index.ts:51


toJSON#

toJSON(): T

Returns#

T

Defined in#

src/message/index.ts:31


from#

Static from<M>(message): Message<M>

Builds a new message object in the synchronous driver. +Used by the eventBus.

Type parameters#

Name
M

Parameters#

NameTypeDescription
messageMany message that can be buffered

Returns#

Message<M>

Defined in#

src/message/index.ts:14


fromGCloud#

Static fromGCloud(message): Message<unknown>

Builds a message for Google Cloud Driver

Parameters#

NameTypeDescription
messageMessageA valid Google Cloud message

Returns#

Message<unknown>

Defined in#

src/message/index.ts:24

+ \ No newline at end of file diff --git a/api/classes/PubSubService/index.html b/api/classes/PubSubService/index.html index 547aab1e..f182f16c 100644 --- a/api/classes/PubSubService/index.html +++ b/api/classes/PubSubService/index.html @@ -6,13 +6,13 @@ Class: PubSubService | Pub/Sub Node.js Framework - +
-
Skip to main content
Version: v2

Class: PubSubService

Properties#

client#

Static Protected client: PubSubClientV2

Defined in#

src/service/pubsub.ts:13


driver#

Static Protected driver: "synchronous" | "google"

Defined in#

src/service/pubsub.ts:15


instance#

Static Protected instance: PubSubService

Defined in#

src/service/pubsub.ts:14

Methods#

closeAll#

closeAll(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:129


getAllSubscriptions#

getAllSubscriptions(): Promise<AllSubscriptions[]>

Retrieves a list of subscribers

Returns#

Promise<AllSubscriptions[]>

Defined in#

src/service/pubsub.ts:218


getSubscribers#

getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/pubsub.ts:125


initClient#

initClient(): void

Returns#

void

Defined in#

src/service/pubsub.ts:90


publish#

publish<T>(topic, message, options?): Promise<string>

Publishes new orders to PubSub.

Type parameters#

NameType
Textends TopicProperties

Parameters#

NameType
topicT
messageRecord<string, unknown>
options?PublishOptions

Returns#

Promise<string>

Defined in#

src/service/pubsub.ts:108


startSubscriptions#

startSubscriptions(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:148


subscribe#

subscribe(subscription): Promise<void>

Subscribes to any given topic

Parameters#

NameType
subscriptionSubscriberTuple

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:211


getInstance#

Static getInstance(): PubSubService

Returns#

PubSubService

Defined in#

src/service/pubsub.ts:98


isHealthy#

Static isHealthy(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:49

- +
Skip to main content
Version: v2

Class: PubSubService

Properties#

client#

Static Protected client: PubSubClientV2

Defined in#

src/service/pubsub.ts:13


driver#

Static Protected driver: "synchronous" | "google"

Defined in#

src/service/pubsub.ts:15


instance#

Static Protected instance: PubSubService

Defined in#

src/service/pubsub.ts:14

Methods#

closeAll#

closeAll(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:123


getAllSubscriptions#

getAllSubscriptions(): Promise<AllSubscriptions[]>

Retrieves a list of subscribers

Returns#

Promise<AllSubscriptions[]>

Defined in#

src/service/pubsub.ts:213


getSubscribers#

getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/pubsub.ts:119


initClient#

initClient(): void

Returns#

void

Defined in#

src/service/pubsub.ts:84


publish#

publish<T>(topic, message, options?): Promise<string>

Publishes new orders to PubSub.

Type parameters#

NameType
Textends TopicProperties

Parameters#

NameType
topicT
messageRecord<string, unknown>
options?PublishOptions

Returns#

Promise<string>

Defined in#

src/service/pubsub.ts:102


startSubscriptions#

startSubscriptions(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:144


subscribe#

subscribe(subscription): Promise<void>

Subscribes to any given topic

Parameters#

NameType
subscriptionSubscriberTuple

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:206


getInstance#

Static getInstance(): PubSubService

Returns#

PubSubService

Defined in#

src/service/pubsub.ts:92


isHealthy#

Static isHealthy(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:48

+ \ No newline at end of file diff --git a/api/classes/SubscriptionService/index.html b/api/classes/SubscriptionService/index.html index b00668c8..e3b5b5f0 100644 --- a/api/classes/SubscriptionService/index.html +++ b/api/classes/SubscriptionService/index.html @@ -6,16 +6,16 @@ Class: SubscriptionService | Pub/Sub Node.js Framework - +
-
Skip to main content
Version: v2

Class: SubscriptionService

Constructors#

constructor#

new SubscriptionService()

Defined in#

src/service/subscription.ts:23

Properties#

defaultSubscriberOptions#

Static defaultSubscriberOptions: SubscriberOptions

All subscriptions will inherit from this default options object

Defined in#

src/service/subscription.ts:21


subscribers#

Static subscribers: SubscriberObject<any>[] = []

Defined in#

src/service/subscription.ts:14

Methods#

closeAll#

Static closeAll(): Promise<void>

Call this function from a process exit handler to close all current subscriptions

Returns#

Promise<void>

Defined in#

src/service/subscription.ts:64


getSubscribers#

Static getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/subscription.ts:68


handleError#

Static handleError(error, metadata): void

If passed, it would serve as the default error handler for all subscriptions. +

Version: v2

Class: SubscriptionService

Constructors#

constructor#

new SubscriptionService()

Defined in#

src/service/subscription.ts:23

Properties#

defaultSubscriberOptions#

Static defaultSubscriberOptions: SubscriberOptions

All subscriptions will inherit from this default options object

Defined in#

src/service/subscription.ts:21


subscribers#

Static subscribers: SubscriberObject<any>[] = []

Defined in#

src/service/subscription.ts:14

Methods#

closeAll#

Static closeAll(): Promise<void>

Call this function from a process exit handler to close all current subscriptions

Returns#

Promise<void>

Defined in#

src/service/subscription.ts:64


getSubscribers#

Static getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/subscription.ts:68


handleError#

Static handleError(err, metadata): void

If passed, it would serve as the default error handler for all subscriptions. Applications should override this with custom error handling: log error, cleanup resources and exit the process. -Default logs the error and rethrows

Parameters#

NameType
errorError
metadataSubscriberMetadata

Returns#

void

Defined in#

src/service/subscription.ts:51


init#

Static init(): Promise<void>

Can be used to initialize process level globals (like DB Connections). -Default is a no-op

Returns#

Promise<void>

Defined in#

src/service/subscription.ts:42


loadSubscriptionService#

Static loadSubscriptionService(): typeof SubscriptionService

Returns#

typeof SubscriptionService

Defined in#

src/service/subscription.ts:112

- +Default logs the error and rethrows

Parameters#

NameType
errError
metadataSubscriberMetadata

Returns#

void

Defined in#

src/service/subscription.ts:51


init#

Static init(): Promise<void>

Can be used to initialize process level globals (like DB Connections). +Default is a no-op

Returns#

Promise<void>

Defined in#

src/service/subscription.ts:42


loadSubscriptionService#

Static loadSubscriptionService(): typeof SubscriptionService

Returns#

typeof SubscriptionService

Defined in#

src/service/subscription.ts:112

+ \ No newline at end of file diff --git a/api/classes/Topic/index.html b/api/classes/Topic/index.html index e7ade61e..e547c72e 100644 --- a/api/classes/Topic/index.html +++ b/api/classes/Topic/index.html @@ -6,14 +6,14 @@ Class: Topic<P> | Pub/Sub Node.js Framework - +
-
Skip to main content
Version: v2

Class: Topic<P>

Type parameters#

NameType
Pextends PayloadPayload

Constructors#

constructor#

new Topic<P>()

Type parameters#

NameType
Pextends PayloadPayload

Defined in#

src/topic/index.ts:59

Properties#

options#

options: TopicOptions

Defined in#

src/topic/index.ts:42


project#

Static Optional project: GooglePubSubProject

Defined in#

src/topic/index.ts:40


topicName#

Static Readonly topicName: string

Defined in#

src/topic/index.ts:39

Methods#

publish#

publish(message, options?): Promise<string>

Parameters#

NameType
messagePayloadInput<P>
options?TopicPublishOptions

Returns#

Promise<string>

Defined in#

src/topic/index.ts:85


validateMessage#

validateMessage(message): void

This is run before publishing any messages, it is a no-op by default. -Can overwrite to perform checks against payload before publishing

Parameters#

NameTypeDescription
messagePayloadInput<P>Message to be published

Returns#

void

Defined in#

src/topic/index.ts:81


validateTopic#

Static validateTopic(name): void

This is run once when Topic is init to verify topic name

Parameters#

NameTypeDescription
namestringtopicName

Returns#

void

Defined in#

src/topic/index.ts:70

- +
Skip to main content
Version: v2

Class: Topic<P>

Type parameters#

NameType
Pextends PayloadPayload

Constructors#

constructor#

new Topic<P>()

Type parameters#

NameType
Pextends PayloadPayload

Defined in#

src/topic/index.ts:76

Properties#

options#

options: TopicOptions = defaultOptions

Defined in#

src/topic/index.ts:73


project#

Static Optional project: GooglePubSubProject

Defined in#

src/topic/index.ts:68


topicName#

Static Readonly topicName: string

Defined in#

src/topic/index.ts:67

Methods#

publish#

publish(message, options?): Promise<string>

Parameters#

NameType
messagePayloadInput<P>
options?TopicPublishOptions

Returns#

Promise<string>

Defined in#

src/topic/index.ts:127


validateMessage#

validateMessage(message): void

This is run before publishing any messages, it is a no-op by default. +Can overwrite to perform checks against payload before publishing

Parameters#

NameTypeDescription
messagePayloadInput<P>Message to be published

Returns#

void

Defined in#

src/topic/index.ts:99


validateTopic#

Static validateTopic(name): void

This is run once when Topic is init to verify topic name

Parameters#

NameTypeDescription
namestringtopicName

Returns#

void

Defined in#

src/topic/index.ts:88

+ \ No newline at end of file diff --git a/api/index.html b/api/index.html index 8abb1e50..4aa7f12c 100644 --- a/api/index.html +++ b/api/index.html @@ -6,13 +6,13 @@ @honestfoodcompany/pubsub | Pub/Sub Node.js Framework - +
-
Skip to main content
- +
Skip to main content
+ \ No newline at end of file diff --git a/api/interfaces/Payload/index.html b/api/interfaces/Payload/index.html index 33c68bc4..e2359535 100644 --- a/api/interfaces/Payload/index.html +++ b/api/interfaces/Payload/index.html @@ -6,14 +6,14 @@ Interface: Payload | Pub/Sub Node.js Framework - +
Skip to main content
- +e.g.

interface YourTopicPayload extends Payload {
id: number;
action: string;
}

Properties#

_timestamp#

Optional _timestamp: string

Defined in#

src/topic/index.ts:22

+ \ No newline at end of file diff --git a/api/interfaces/SubscriberMetadata/index.html b/api/interfaces/SubscriberMetadata/index.html index 1a799739..222cf56f 100644 --- a/api/interfaces/SubscriberMetadata/index.html +++ b/api/interfaces/SubscriberMetadata/index.html @@ -5,14 +5,14 @@ -Interface: SubscriberMetadata | Pub/Sub Node.js Framework - +Interface: SubscriberMetadata | Pub/Sub Node.js Framework +
-
Skip to main content
- +
Skip to main content
+ \ No newline at end of file diff --git a/api/interfaces/SubscriberObject/index.html b/api/interfaces/SubscriberObject/index.html index ebe90ad5..82a6c828 100644 --- a/api/interfaces/SubscriberObject/index.html +++ b/api/interfaces/SubscriberObject/index.html @@ -6,13 +6,13 @@ Interface: SubscriberObject<T> | Pub/Sub Node.js Framework - +
-
Skip to main content
Version: v2

Interface: SubscriberObject<T>

Type parameters#

NameType
Tunknown

Hierarchy#

Properties#

description#

Optional description: string

Inherited from#

SubscriberMetadata.description

Defined in#

src/subscriber/subscriberV2.ts:110


options#

Optional options: SubscriberOptions

Inherited from#

SubscriberMetadata.options

Defined in#

src/subscriber/subscriberV2.ts:111


subscriptionName#

subscriptionName: string

Inherited from#

SubscriberMetadata.subscriptionName

Defined in#

src/subscriber/subscriberV2.ts:109


topicName#

topicName: string

Inherited from#

SubscriberMetadata.topicName

Defined in#

src/subscriber/subscriberV2.ts:108

Methods#

handleError#

Optional handleError(error): void

If passed, it would serve as the error handler method for internal google pubsub errors

Parameters#

NameType
errorError

Returns#

void

Inherited from#

MessageHandler.handleError

Defined in#

src/subscriber/subscriberV2.ts:128


handleMessage#

handleMessage(message): void

will run every time a message is received

Parameters#

NameType
messageMessage<T>

Returns#

void

Inherited from#

MessageHandler.handleMessage

Defined in#

src/subscriber/subscriberV2.ts:118


init#

Optional init(): void

will run before the message handler is attached to the subscription

Returns#

void

Inherited from#

MessageHandler.init

Defined in#

src/subscriber/subscriberV2.ts:123

- +
Skip to main content
Version: v2

Interface: SubscriberObject<T>

Type parameters#

NameType
Tunknown

Hierarchy#

Properties#

description#

Optional description: string

Inherited from#

Omit.description

Defined in#

src/subscriber/subscriberV2.ts:113


options#

Optional options: SubscriberOptions

Defined in#

src/subscriber/subscriberV2.ts:142


subscriptionName#

subscriptionName: string

Inherited from#

Omit.subscriptionName

Defined in#

src/subscriber/subscriberV2.ts:111


topicName#

topicName: string

Inherited from#

Omit.topicName

Defined in#

src/subscriber/subscriberV2.ts:110

Methods#

handleError#

Optional handleError(error): void

If passed, it would serve as the error handler method for internal google pubsub errors

Parameters#

NameType
errorError

Returns#

void

Inherited from#

MessageHandler.handleError

Defined in#

src/subscriber/subscriberV2.ts:130


handleMessage#

handleMessage(message): void

will run every time a message is received

Parameters#

NameType
messageMessage<T>

Returns#

void

Inherited from#

MessageHandler.handleMessage

Defined in#

src/subscriber/subscriberV2.ts:120


init#

Optional init(): void

will run before the message handler is attached to the subscription

Returns#

void

Inherited from#

MessageHandler.init

Defined in#

src/subscriber/subscriberV2.ts:125

+ \ No newline at end of file diff --git a/api/interfaces/SubscriberOptions/index.html b/api/interfaces/SubscriberOptions/index.html index cd82a5f9..91a04d99 100644 --- a/api/interfaces/SubscriberOptions/index.html +++ b/api/interfaces/SubscriberOptions/index.html @@ -6,20 +6,20 @@ Interface: SubscriberOptions | Pub/Sub Node.js Framework - +
-
Skip to main content
Version: v2

Interface: SubscriberOptions

Hierarchy#

  • GoogleCloudSubscriberOptions

    SubscriberOptions

Properties#

ackDeadline#

Optional ackDeadline: number

Inherited from#

GoogleCloudSubscriberOptions.ackDeadline

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:105


batching#

Optional batching: BatchOptions

Inherited from#

GoogleCloudSubscriberOptions.batching

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:106


deadLetterPolicy#

Optional deadLetterPolicy: Object

Type declaration#

NameType
createDefaultSubscription?boolean
deadLetterTopicstring
maxDeliveryAttemptsnumber

Defined in#

src/subscriber/subscriberV2.ts:73


enableMessageOrdering#

Optional enableMessageOrdering: boolean

If true, messages published with the same ordering_key in PubsubMessage +

Version: v2

Interface: SubscriberOptions

Hierarchy#

  • GoogleCloudSubscriberOptions

    SubscriberOptions

Properties#

ackDeadline#

Optional ackDeadline: number

Inherited from#

GoogleCloudSubscriberOptions.ackDeadline

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:105


batching#

Optional batching: BatchOptions

Inherited from#

GoogleCloudSubscriberOptions.batching

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:106


deadLetterPolicy#

Optional deadLetterPolicy: Object

Type declaration#

NameType
createDefaultSubscription?boolean
deadLetterTopicstring
maxDeliveryAttemptsnumber

Defined in#

src/subscriber/subscriberV2.ts:75


enableMessageOrdering#

Optional enableMessageOrdering: boolean

If true, messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system. Otherwise, they may be delivered in -any order.

Defined in#

src/subscriber/subscriberV2.ts:104


enableOpenTelemetryTracing#

Optional enableOpenTelemetryTracing: boolean

Inherited from#

GoogleCloudSubscriberOptions.enableOpenTelemetryTracing

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:110


filter#

Optional filter: string

An expression written in the Pub/Sub filter +any order.

Defined in#

src/subscriber/subscriberV2.ts:106


enableOpenTelemetryTracing#

Optional enableOpenTelemetryTracing: boolean

Inherited from#

GoogleCloudSubscriberOptions.enableOpenTelemetryTracing

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:110


filter#

Optional filter: string

An expression written in the Pub/Sub filter language. If non-empty, then only PubsubMessages whose attributes field matches the filter are delivered on this subscription. If empty, then no messages are filtered -out.

Defined in#

src/subscriber/subscriberV2.ts:96


flowControl#

Optional flowControl: FlowControlOptions

Inherited from#

GoogleCloudSubscriberOptions.flowControl

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:107


labels#

Optional labels: null | { [k: string]: string; }

Defined in#

src/subscriber/subscriberV2.ts:72


project#

Optional project: GooglePubSubProject

Defined in#

src/subscriber/subscriberV2.ts:71


retryPolicy#

Optional retryPolicy: Object

Type declaration#

NameType
maximumBackoffObject
maximumBackoff.nanos?number
maximumBackoff.secondsnumber
minimumBackoffObject
minimumBackoff.nanos?number
minimumBackoff.secondsnumber

Defined in#

src/subscriber/subscriberV2.ts:78


streamingOptions#

Optional streamingOptions: MessageStreamOptions

Inherited from#

GoogleCloudSubscriberOptions.streamingOptions

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:109


useLegacyFlowControl#

Optional useLegacyFlowControl: boolean

Inherited from#

GoogleCloudSubscriberOptions.useLegacyFlowControl

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:108

- +out.

Defined in#

src/subscriber/subscriberV2.ts:98


flowControl#

Optional flowControl: FlowControlOptions

Inherited from#

GoogleCloudSubscriberOptions.flowControl

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:107


labels#

Optional labels: null | { [k: string]: string; }

Defined in#

src/subscriber/subscriberV2.ts:74


project#

Optional project: GooglePubSubProject

Defined in#

src/subscriber/subscriberV2.ts:73


retryPolicy#

Optional retryPolicy: Object

Type declaration#

NameType
maximumBackoffObject
maximumBackoff.nanos?number
maximumBackoff.secondsnumber
minimumBackoffObject
minimumBackoff.nanos?number
minimumBackoff.secondsnumber

Defined in#

src/subscriber/subscriberV2.ts:80


streamingOptions#

Optional streamingOptions: MessageStreamOptions

Inherited from#

GoogleCloudSubscriberOptions.streamingOptions

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:109


useLegacyFlowControl#

Optional useLegacyFlowControl: boolean

Inherited from#

GoogleCloudSubscriberOptions.useLegacyFlowControl

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:108

+ \ No newline at end of file diff --git a/api/interfaces/TopicOptions/index.html b/api/interfaces/TopicOptions/index.html index f495e155..3fd0dc6a 100644 --- a/api/interfaces/TopicOptions/index.html +++ b/api/interfaces/TopicOptions/index.html @@ -6,13 +6,13 @@ Interface: TopicOptions | Pub/Sub Node.js Framework - +
-
Skip to main content
- +
Skip to main content
+ \ No newline at end of file diff --git a/assets/js/13caf63c.dc040e5e.js b/assets/js/13caf63c.6a54c260.js similarity index 93% rename from assets/js/13caf63c.dc040e5e.js rename to assets/js/13caf63c.6a54c260.js index 7933c59d..5095109d 100644 --- a/assets/js/13caf63c.dc040e5e.js +++ b/assets/js/13caf63c.6a54c260.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[835],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>c});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=r.createContext({}),d=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},s=function(e){var t=d(e.components);return r.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,p=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),b=d(n),c=i,m=b["".concat(p,".").concat(c)]||b[c]||u[c]||a;return n?r.createElement(m,l(l({ref:t},s),{},{components:n})):r.createElement(m,l({ref:t},s))}));function c(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,l=new Array(a);l[0]=b;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var d=2;d{n.r(t),n.d(t,{default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>d});var r=n(7462),i=n(3366),a=(n(7294),n(3905)),l=["components"],o={id:"SubscriberOptions",title:"Interface: SubscriberOptions",sidebar_label:"SubscriberOptions",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/interfaces/SubscriberOptions",id:"api/interfaces/SubscriberOptions",isDocsHomePage:!1,title:"Interface: SubscriberOptions",description:"Hierarchy",source:"@site/docs/api/interfaces/SubscriberOptions.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/SubscriberOptions",permalink:"/hfc-pubsub/api/interfaces/SubscriberOptions",editUrl:null,version:"current",sidebar_label:"SubscriberOptions",sidebarPosition:0,frontMatter:{id:"SubscriberOptions",title:"Interface: SubscriberOptions",sidebar_label:"SubscriberOptions",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: SubscriberObject",permalink:"/hfc-pubsub/api/interfaces/SubscriberObject"},next:{title:"Interface: TopicOptions",permalink:"/hfc-pubsub/api/interfaces/TopicOptions"}},d=[{value:"Hierarchy",id:"hierarchy",children:[]},{value:"Properties",id:"properties",children:[{value:"ackDeadline",id:"ackdeadline",children:[]},{value:"batching",id:"batching",children:[]},{value:"deadLetterPolicy",id:"deadletterpolicy",children:[]},{value:"enableMessageOrdering",id:"enablemessageordering",children:[]},{value:"enableOpenTelemetryTracing",id:"enableopentelemetrytracing",children:[]},{value:"filter",id:"filter",children:[]},{value:"flowControl",id:"flowcontrol",children:[]},{value:"labels",id:"labels",children:[]},{value:"project",id:"project",children:[]},{value:"retryPolicy",id:"retrypolicy",children:[]},{value:"streamingOptions",id:"streamingoptions",children:[]},{value:"useLegacyFlowControl",id:"uselegacyflowcontrol",children:[]}]}],s={toc:d};function u(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"hierarchy"},"Hierarchy"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("p",{parentName:"li"},(0,a.kt)("inlineCode",{parentName:"p"},"GoogleCloudSubscriberOptions")),(0,a.kt)("p",{parentName:"li"},"\u21b3 ",(0,a.kt)("strong",{parentName:"p"},(0,a.kt)("inlineCode",{parentName:"strong"},"SubscriberOptions"))))),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"ackdeadline"},"ackDeadline"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"ackDeadline"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"number")),(0,a.kt)("h4",{id:"inherited-from"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.ackDeadline"),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:105"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"batching"},"batching"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"batching"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"BatchOptions")),(0,a.kt)("h4",{id:"inherited-from-1"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.batching"),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:106"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"deadletterpolicy"},"deadLetterPolicy"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"deadLetterPolicy"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"Object")),(0,a.kt)("h4",{id:"type-declaration"},"Type declaration"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"createDefaultSubscription?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"boolean"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"deadLetterTopic")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maxDeliveryAttempts")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))))),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L73"},"src/subscriber/subscriberV2.ts:73")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"enablemessageordering"},"enableMessageOrdering"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"enableMessageOrdering"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("p",null," If true, messages published with the same ",(0,a.kt)("inlineCode",{parentName:"p"},"ordering_key")," in ",(0,a.kt)("inlineCode",{parentName:"p"},"PubsubMessage"),"\nwill be delivered to the subscribers in the order in which they\nare received by the Pub/Sub system. Otherwise, they may be delivered in\nany order."),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L104"},"src/subscriber/subscriberV2.ts:104")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"enableopentelemetrytracing"},"enableOpenTelemetryTracing"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"enableOpenTelemetryTracing"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"inherited-from-2"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.enableOpenTelemetryTracing"),(0,a.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:110"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"filter"},"filter"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"filter"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("p",null," An expression written in the Pub/Sub ",(0,a.kt)("a",{parentName:"p",href:"https://cloud.google.com/pubsub/docs/filtering"},"filter\nlanguage"),". If non-empty,\nthen only ",(0,a.kt)("inlineCode",{parentName:"p"},"PubsubMessage"),"s whose ",(0,a.kt)("inlineCode",{parentName:"p"},"attributes")," field matches the filter are\ndelivered on this subscription. If empty, then no messages are filtered\nout."),(0,a.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L96"},"src/subscriber/subscriberV2.ts:96")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"flowcontrol"},"flowControl"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"flowControl"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"FlowControlOptions")),(0,a.kt)("h4",{id:"inherited-from-3"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.flowControl"),(0,a.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:107"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"labels"},"labels"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"labels"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"null")," ","|"," { ","[k: string]",": ",(0,a.kt)("inlineCode",{parentName:"p"},"string"),"; }"),(0,a.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L72"},"src/subscriber/subscriberV2.ts:72")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"project"},"project"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"project"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"GooglePubSubProject")),(0,a.kt)("h4",{id:"defined-in-8"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L71"},"src/subscriber/subscriberV2.ts:71")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"retrypolicy"},"retryPolicy"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"retryPolicy"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"Object")),(0,a.kt)("h4",{id:"type-declaration-1"},"Type declaration"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maximumBackoff")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Object"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maximumBackoff.nanos?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maximumBackoff.seconds")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"minimumBackoff")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Object"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"minimumBackoff.nanos?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"minimumBackoff.seconds")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))))),(0,a.kt)("h4",{id:"defined-in-9"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L78"},"src/subscriber/subscriberV2.ts:78")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"streamingoptions"},"streamingOptions"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"streamingOptions"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"MessageStreamOptions")),(0,a.kt)("h4",{id:"inherited-from-4"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.streamingOptions"),(0,a.kt)("h4",{id:"defined-in-10"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:109"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"uselegacyflowcontrol"},"useLegacyFlowControl"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"useLegacyFlowControl"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"inherited-from-5"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.useLegacyFlowControl"),(0,a.kt)("h4",{id:"defined-in-11"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:108"))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[835],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>c});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=r.createContext({}),d=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},s=function(e){var t=d(e.components);return r.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,p=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),b=d(n),c=i,m=b["".concat(p,".").concat(c)]||b[c]||u[c]||a;return n?r.createElement(m,l(l({ref:t},s),{},{components:n})):r.createElement(m,l({ref:t},s))}));function c(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,l=new Array(a);l[0]=b;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var d=2;d{n.r(t),n.d(t,{default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>d});var r=n(7462),i=n(3366),a=(n(7294),n(3905)),l=["components"],o={id:"SubscriberOptions",title:"Interface: SubscriberOptions",sidebar_label:"SubscriberOptions",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/interfaces/SubscriberOptions",id:"api/interfaces/SubscriberOptions",isDocsHomePage:!1,title:"Interface: SubscriberOptions",description:"Hierarchy",source:"@site/docs/api/interfaces/SubscriberOptions.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/SubscriberOptions",permalink:"/hfc-pubsub/api/interfaces/SubscriberOptions",editUrl:null,version:"current",sidebar_label:"SubscriberOptions",sidebarPosition:0,frontMatter:{id:"SubscriberOptions",title:"Interface: SubscriberOptions",sidebar_label:"SubscriberOptions",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: SubscriberObject",permalink:"/hfc-pubsub/api/interfaces/SubscriberObject"},next:{title:"Interface: TopicOptions",permalink:"/hfc-pubsub/api/interfaces/TopicOptions"}},d=[{value:"Hierarchy",id:"hierarchy",children:[]},{value:"Properties",id:"properties",children:[{value:"ackDeadline",id:"ackdeadline",children:[]},{value:"batching",id:"batching",children:[]},{value:"deadLetterPolicy",id:"deadletterpolicy",children:[]},{value:"enableMessageOrdering",id:"enablemessageordering",children:[]},{value:"enableOpenTelemetryTracing",id:"enableopentelemetrytracing",children:[]},{value:"filter",id:"filter",children:[]},{value:"flowControl",id:"flowcontrol",children:[]},{value:"labels",id:"labels",children:[]},{value:"project",id:"project",children:[]},{value:"retryPolicy",id:"retrypolicy",children:[]},{value:"streamingOptions",id:"streamingoptions",children:[]},{value:"useLegacyFlowControl",id:"uselegacyflowcontrol",children:[]}]}],s={toc:d};function u(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"hierarchy"},"Hierarchy"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("p",{parentName:"li"},(0,a.kt)("inlineCode",{parentName:"p"},"GoogleCloudSubscriberOptions")),(0,a.kt)("p",{parentName:"li"},"\u21b3 ",(0,a.kt)("strong",{parentName:"p"},(0,a.kt)("inlineCode",{parentName:"strong"},"SubscriberOptions"))))),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"ackdeadline"},"ackDeadline"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"ackDeadline"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"number")),(0,a.kt)("h4",{id:"inherited-from"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.ackDeadline"),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:105"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"batching"},"batching"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"batching"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"BatchOptions")),(0,a.kt)("h4",{id:"inherited-from-1"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.batching"),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:106"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"deadletterpolicy"},"deadLetterPolicy"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"deadLetterPolicy"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"Object")),(0,a.kt)("h4",{id:"type-declaration"},"Type declaration"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"createDefaultSubscription?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"boolean"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"deadLetterTopic")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"string"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maxDeliveryAttempts")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))))),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L75"},"src/subscriber/subscriberV2.ts:75")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"enablemessageordering"},"enableMessageOrdering"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"enableMessageOrdering"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("p",null," If true, messages published with the same ",(0,a.kt)("inlineCode",{parentName:"p"},"ordering_key")," in ",(0,a.kt)("inlineCode",{parentName:"p"},"PubsubMessage"),"\nwill be delivered to the subscribers in the order in which they\nare received by the Pub/Sub system. Otherwise, they may be delivered in\nany order."),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L106"},"src/subscriber/subscriberV2.ts:106")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"enableopentelemetrytracing"},"enableOpenTelemetryTracing"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"enableOpenTelemetryTracing"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"inherited-from-2"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.enableOpenTelemetryTracing"),(0,a.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:110"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"filter"},"filter"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"filter"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("p",null," An expression written in the Pub/Sub ",(0,a.kt)("a",{parentName:"p",href:"https://cloud.google.com/pubsub/docs/filtering"},"filter\nlanguage"),". If non-empty,\nthen only ",(0,a.kt)("inlineCode",{parentName:"p"},"PubsubMessage"),"s whose ",(0,a.kt)("inlineCode",{parentName:"p"},"attributes")," field matches the filter are\ndelivered on this subscription. If empty, then no messages are filtered\nout."),(0,a.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L98"},"src/subscriber/subscriberV2.ts:98")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"flowcontrol"},"flowControl"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"flowControl"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"FlowControlOptions")),(0,a.kt)("h4",{id:"inherited-from-3"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.flowControl"),(0,a.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:107"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"labels"},"labels"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"labels"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"null")," ","|"," { ","[k: string]",": ",(0,a.kt)("inlineCode",{parentName:"p"},"string"),"; }"),(0,a.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L74"},"src/subscriber/subscriberV2.ts:74")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"project"},"project"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"project"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"GooglePubSubProject")),(0,a.kt)("h4",{id:"defined-in-8"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L73"},"src/subscriber/subscriberV2.ts:73")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"retrypolicy"},"retryPolicy"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"retryPolicy"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"Object")),(0,a.kt)("h4",{id:"type-declaration-1"},"Type declaration"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maximumBackoff")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Object"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maximumBackoff.nanos?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"maximumBackoff.seconds")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"minimumBackoff")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Object"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"minimumBackoff.nanos?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"minimumBackoff.seconds")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"number"))))),(0,a.kt)("h4",{id:"defined-in-9"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L80"},"src/subscriber/subscriberV2.ts:80")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"streamingoptions"},"streamingOptions"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"streamingOptions"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"MessageStreamOptions")),(0,a.kt)("h4",{id:"inherited-from-4"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.streamingOptions"),(0,a.kt)("h4",{id:"defined-in-10"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:109"),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"uselegacyflowcontrol"},"useLegacyFlowControl"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"useLegacyFlowControl"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"inherited-from-5"},"Inherited from"),(0,a.kt)("p",null,"GoogleCloudSubscriberOptions.useLegacyFlowControl"),(0,a.kt)("h4",{id:"defined-in-11"},"Defined in"),(0,a.kt)("p",null,"node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:108"))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/157e1c0d.a8c504ea.js b/assets/js/157e1c0d.a8c504ea.js deleted file mode 100644 index 5df9861b..00000000 --- a/assets/js/157e1c0d.a8c504ea.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[139],{3905:(e,t,n)=>{n.d(t,{Zo:()=>l,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},l=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,c=e.parentName,l=a(e,["components","mdxType","originalType","parentName"]),d=s(n),f=i,b=d["".concat(c,".").concat(f)]||d[f]||u[f]||o;return n?r.createElement(b,p(p({ref:t},l),{},{components:n})):r.createElement(b,p({ref:t},l))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,p=new Array(o);p[0]=d;var a={};for(var c in t)hasOwnProperty.call(t,c)&&(a[c]=t[c]);a.originalType=e,a.mdxType="string"==typeof e?e:i,p[1]=a;for(var s=2;s{n.r(t),n.d(t,{default:()=>u,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var r=n(7462),i=n(3366),o=(n(7294),n(3905)),p=["components"],a={id:"TopicOptions",title:"Interface: TopicOptions",sidebar_label:"TopicOptions",sidebar_position:0,custom_edit_url:null},c={unversionedId:"api/interfaces/TopicOptions",id:"api/interfaces/TopicOptions",isDocsHomePage:!1,title:"Interface: TopicOptions",description:"Properties",source:"@site/docs/api/interfaces/TopicOptions.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/TopicOptions",permalink:"/hfc-pubsub/api/interfaces/TopicOptions",editUrl:null,version:"current",sidebar_label:"TopicOptions",sidebarPosition:0,frontMatter:{id:"TopicOptions",title:"Interface: TopicOptions",sidebar_label:"TopicOptions",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: SubscriberOptions",permalink:"/hfc-pubsub/api/interfaces/SubscriberOptions"},next:{title:"Changelog",permalink:"/hfc-pubsub/changelog"}},s=[{value:"Properties",id:"properties",children:[{value:"addTimeStamp",id:"addtimestamp",children:[]},{value:"enableGZipCompression",id:"enablegzipcompression",children:[]},{value:"retryConfig",id:"retryconfig",children:[]}]}],l={toc:s};function u(e){var t=e.components,n=(0,i.Z)(e,p);return(0,o.kt)("wrapper",(0,r.Z)({},l,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"properties"},"Properties"),(0,o.kt)("h3",{id:"addtimestamp"},"addTimeStamp"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"addTimeStamp"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"boolean")),(0,o.kt)("h4",{id:"defined-in"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L28"},"src/topic/index.ts:28")),(0,o.kt)("hr",null),(0,o.kt)("h3",{id:"enablegzipcompression"},"enableGZipCompression"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"enableGZipCompression"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"boolean")),(0,o.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L30"},"src/topic/index.ts:30")),(0,o.kt)("hr",null),(0,o.kt)("h3",{id:"retryconfig"},"retryConfig"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"retryConfig"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"RetryConfig")),(0,o.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L29"},"src/topic/index.ts:29")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/157e1c0d.df0a2536.js b/assets/js/157e1c0d.df0a2536.js new file mode 100644 index 00000000..a4c1302f --- /dev/null +++ b/assets/js/157e1c0d.df0a2536.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[139],{3905:(e,t,n)=>{n.d(t,{Zo:()=>s,kt:()=>f});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=r.createContext({}),c=function(e){var t=r.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},s=function(e){var t=c(e.components);return r.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},u=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,s=a(e,["components","mdxType","originalType","parentName"]),u=c(n),f=i,b=u["".concat(l,".").concat(f)]||u[f]||d[f]||o;return n?r.createElement(b,p(p({ref:t},s),{},{components:n})):r.createElement(b,p({ref:t},s))}));function f(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=n.length,p=new Array(o);p[0]=u;var a={};for(var l in t)hasOwnProperty.call(t,l)&&(a[l]=t[l]);a.originalType=e,a.mdxType="string"==typeof e?e:i,p[1]=a;for(var c=2;c{n.r(t),n.d(t,{default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var r=n(7462),i=n(3366),o=(n(7294),n(3905)),p=["components"],a={id:"TopicOptions",title:"Interface: TopicOptions",sidebar_label:"TopicOptions",sidebar_position:0,custom_edit_url:null},l={unversionedId:"api/interfaces/TopicOptions",id:"api/interfaces/TopicOptions",isDocsHomePage:!1,title:"Interface: TopicOptions",description:"Properties",source:"@site/docs/api/interfaces/TopicOptions.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/TopicOptions",permalink:"/hfc-pubsub/api/interfaces/TopicOptions",editUrl:null,version:"current",sidebar_label:"TopicOptions",sidebarPosition:0,frontMatter:{id:"TopicOptions",title:"Interface: TopicOptions",sidebar_label:"TopicOptions",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: SubscriberOptions",permalink:"/hfc-pubsub/api/interfaces/SubscriberOptions"},next:{title:"Changelog",permalink:"/hfc-pubsub/changelog"}},c=[{value:"Properties",id:"properties",children:[{value:"addTimeStamp",id:"addtimestamp",children:[]},{value:"enableGZipCompression",id:"enablegzipcompression",children:[]},{value:"labels",id:"labels",children:[]},{value:"retryConfig",id:"retryconfig",children:[]}]}],s={toc:c};function d(e){var t=e.components,n=(0,i.Z)(e,p);return(0,o.kt)("wrapper",(0,r.Z)({},s,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"properties"},"Properties"),(0,o.kt)("h3",{id:"addtimestamp"},"addTimeStamp"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"addTimeStamp"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"boolean")),(0,o.kt)("h4",{id:"defined-in"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L30"},"src/topic/index.ts:30")),(0,o.kt)("hr",null),(0,o.kt)("h3",{id:"enablegzipcompression"},"enableGZipCompression"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"enableGZipCompression"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"boolean")),(0,o.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L33"},"src/topic/index.ts:33")),(0,o.kt)("hr",null),(0,o.kt)("h3",{id:"labels"},"labels"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"labels"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"null")," ","|"," { ","[k: string]",": ",(0,o.kt)("inlineCode",{parentName:"p"},"string"),"; }"),(0,o.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L31"},"src/topic/index.ts:31")),(0,o.kt)("hr",null),(0,o.kt)("h3",{id:"retryconfig"},"retryConfig"),(0,o.kt)("p",null,"\u2022 ",(0,o.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,o.kt)("strong",{parentName:"p"},"retryConfig"),": ",(0,o.kt)("inlineCode",{parentName:"p"},"RetryConfig")),(0,o.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,o.kt)("p",null,(0,o.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L32"},"src/topic/index.ts:32")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1c01e663.47aa78b7.js b/assets/js/1c01e663.02b0d49e.js similarity index 96% rename from assets/js/1c01e663.47aa78b7.js rename to assets/js/1c01e663.02b0d49e.js index e5335982..b969cac5 100644 --- a/assets/js/1c01e663.47aa78b7.js +++ b/assets/js/1c01e663.02b0d49e.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[3680],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),c=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},s=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),d=c(r),f=a,m=d["".concat(l,".").concat(f)]||d[f]||u[f]||i;return r?n.createElement(m,o(o({ref:t},s),{},{components:r})):n.createElement(m,o({ref:t},s))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=d;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:a,o[1]=p;for(var c=2;c{r.r(t),r.d(t,{default:()=>u,frontMatter:()=>p,metadata:()=>l,toc:()=>c});var n=r(7462),a=r(3366),i=(r(7294),r(3905)),o=["components"],p={id:"Payload",title:"Interface: Payload",sidebar_label:"Payload",sidebar_position:0,custom_edit_url:null},l={unversionedId:"api/interfaces/Payload",id:"api/interfaces/Payload",isDocsHomePage:!1,title:"Interface: Payload",description:"extend this interface to define your own payload",source:"@site/docs/api/interfaces/Payload.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/Payload",permalink:"/hfc-pubsub/api/interfaces/Payload",editUrl:null,version:"current",sidebar_label:"Payload",sidebarPosition:0,frontMatter:{id:"Payload",title:"Interface: Payload",sidebar_label:"Payload",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: Topic

",permalink:"/hfc-pubsub/api/classes/Topic"},next:{title:"Interface: SubscriberMetadata",permalink:"/hfc-pubsub/api/interfaces/SubscriberMetadata"}},c=[{value:"Properties",id:"properties",children:[{value:"_timestamp",id:"_timestamp",children:[]}]}],s={toc:c};function u(e){var t=e.components,r=(0,a.Z)(e,o);return(0,i.kt)("wrapper",(0,n.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"extend this interface to define your own payload\ne.g."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-typescript"}," interface YourTopicPayload extends Payload {\n id: number;\n action: string;\n }\n")),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"_timestamp"},"_","timestamp"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"_","timestamp"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L20"},"src/topic/index.ts:20")))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[3680],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>f});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),c=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},s=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),d=c(r),f=a,m=d["".concat(l,".").concat(f)]||d[f]||u[f]||i;return r?n.createElement(m,o(o({ref:t},s),{},{components:r})):n.createElement(m,o({ref:t},s))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,o=new Array(i);o[0]=d;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:a,o[1]=p;for(var c=2;c{r.r(t),r.d(t,{default:()=>u,frontMatter:()=>p,metadata:()=>l,toc:()=>c});var n=r(7462),a=r(3366),i=(r(7294),r(3905)),o=["components"],p={id:"Payload",title:"Interface: Payload",sidebar_label:"Payload",sidebar_position:0,custom_edit_url:null},l={unversionedId:"api/interfaces/Payload",id:"api/interfaces/Payload",isDocsHomePage:!1,title:"Interface: Payload",description:"extend this interface to define your own payload",source:"@site/docs/api/interfaces/Payload.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/Payload",permalink:"/hfc-pubsub/api/interfaces/Payload",editUrl:null,version:"current",sidebar_label:"Payload",sidebarPosition:0,frontMatter:{id:"Payload",title:"Interface: Payload",sidebar_label:"Payload",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: Topic

",permalink:"/hfc-pubsub/api/classes/Topic"},next:{title:"Interface: SubscriberMetadata",permalink:"/hfc-pubsub/api/interfaces/SubscriberMetadata"}},c=[{value:"Properties",id:"properties",children:[{value:"_timestamp",id:"_timestamp",children:[]}]}],s={toc:c};function u(e){var t=e.components,r=(0,a.Z)(e,o);return(0,i.kt)("wrapper",(0,n.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"extend this interface to define your own payload\ne.g."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-typescript"}," interface YourTopicPayload extends Payload {\n id: number;\n action: string;\n }\n")),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"_timestamp"},"_","timestamp"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"_","timestamp"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L22"},"src/topic/index.ts:22")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/246f2c6f.d65c1318.js b/assets/js/246f2c6f.d65c1318.js new file mode 100644 index 00000000..127bc955 --- /dev/null +++ b/assets/js/246f2c6f.d65c1318.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[9285],{6267:e=>{e.exports=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"loadedVersions":[{"versionName":"current","versionLabel":"v2","versionPath":"/hfc-pubsub/","versionEditUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs","versionEditUrlLocalized":"https://github.com/deliveryhero/hfc-pubsub/edit/main/i18n/en/docusaurus-plugin-content-docs/current","isLast":true,"routePriority":-1,"contentPath":"/home/runner/work/hfc-pubsub/hfc-pubsub/docs","contentPathLocalized":"/home/runner/work/hfc-pubsub/hfc-pubsub/i18n/en/docusaurus-plugin-content-docs/current","mainDocId":"introduction","sidebars":{"defaultSidebar":[{"type":"doc","id":"introduction"},{"type":"category","label":"Getting Started","items":[{"type":"doc","id":"getting-started/installation"}],"collapsed":false},{"type":"category","label":"Subscribing","items":[{"type":"doc","id":"subscribing/subscriptions"},{"type":"doc","id":"subscribing/dead-letter-policy","label":"Dead Letter Policy"},{"type":"doc","id":"subscribing/Messages_compression"},{"type":"doc","id":"subscribing/error-handling","label":"Error Handling"},{"type":"doc","id":"subscribing/labels","label":"Labels"},{"type":"doc","id":"subscribing/retry-policy","label":"Retry Policy"},{"type":"doc","id":"subscribing/message-ordering","label":"Message Ordering"}],"collapsed":true},{"type":"category","label":"Publishing","items":[{"type":"doc","id":"publishing/topics"},{"type":"doc","id":"publishing/retry-settings","label":"Retry Settings"},{"type":"doc","id":"publishing/attributes","label":"Attributes"},{"type":"doc","id":"publishing/publish-diff-project","label":"Different GCP project"}],"collapsed":true},{"type":"category","label":"Server","items":[{"type":"doc","id":"server/service"},{"type":"doc","id":"server/custom-logger","label":"Custom Logger"},{"type":"doc","id":"server/connect-database","label":"Connect Database"},{"type":"doc","id":"server/graceful-shutdown"},{"type":"doc","id":"server/health-check"}],"collapsed":true},{"type":"category","label":"Guides","items":[{"type":"doc","id":"guides/cli"},{"type":"doc","id":"guides/drivers"},{"type":"doc","id":"guides/migrating-to-v2"},{"type":"doc","id":"guides/testing"}],"collapsed":true},{"type":"doc","id":"options"},{"type":"category","label":"API","items":[{"type":"doc","id":"api/index","label":"Exports"},{"type":"category","label":"Classes","items":[{"type":"doc","id":"api/classes/Message","label":"Message"},{"type":"doc","id":"api/classes/PubSubService","label":"PubSubService"},{"type":"doc","id":"api/classes/SubscriptionService","label":"SubscriptionService"},{"type":"doc","id":"api/classes/Topic","label":"Topic"}],"collapsed":true},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"api/interfaces/Payload","label":"Payload"},{"type":"doc","id":"api/interfaces/SubscriberMetadata","label":"SubscriberMetadata"},{"type":"doc","id":"api/interfaces/SubscriberObject","label":"SubscriberObject"},{"type":"doc","id":"api/interfaces/SubscriberOptions","label":"SubscriberOptions"},{"type":"doc","id":"api/interfaces/TopicOptions","label":"TopicOptions"}],"collapsed":true}],"collapsed":true},{"type":"doc","id":"changelog"}]},"permalinkToSidebar":{"/hfc-pubsub/api/classes/Message":"defaultSidebar","/hfc-pubsub/api/classes/PubSubService":"defaultSidebar","/hfc-pubsub/api/classes/SubscriptionService":"defaultSidebar","/hfc-pubsub/api/classes/Topic":"defaultSidebar","/hfc-pubsub/api/":"defaultSidebar","/hfc-pubsub/api/interfaces/Payload":"defaultSidebar","/hfc-pubsub/api/interfaces/SubscriberMetadata":"defaultSidebar","/hfc-pubsub/api/interfaces/SubscriberObject":"defaultSidebar","/hfc-pubsub/api/interfaces/SubscriberOptions":"defaultSidebar","/hfc-pubsub/api/interfaces/TopicOptions":"defaultSidebar","/hfc-pubsub/changelog":"defaultSidebar","/hfc-pubsub/getting-started/installation":"defaultSidebar","/hfc-pubsub/guides/cli":"defaultSidebar","/hfc-pubsub/guides/drivers":"defaultSidebar","/hfc-pubsub/guides/migrating-to-v2":"defaultSidebar","/hfc-pubsub/guides/testing":"defaultSidebar","/hfc-pubsub/":"defaultSidebar","/hfc-pubsub/options":"defaultSidebar","/hfc-pubsub/publishing/attributes":"defaultSidebar","/hfc-pubsub/publishing/publish-diff-project":"defaultSidebar","/hfc-pubsub/publishing/retry-settings":"defaultSidebar","/hfc-pubsub/publishing/topics":"defaultSidebar","/hfc-pubsub/server/connect-database":"defaultSidebar","/hfc-pubsub/server/custom-logger":"defaultSidebar","/hfc-pubsub/server/graceful-shutdown":"defaultSidebar","/hfc-pubsub/server/health-check":"defaultSidebar","/hfc-pubsub/server/service":"defaultSidebar","/hfc-pubsub/subscribing/dead-letter-policy":"defaultSidebar","/hfc-pubsub/subscribing/error-handling":"defaultSidebar","/hfc-pubsub/subscribing/labels":"defaultSidebar","/hfc-pubsub/subscribing/message-ordering":"defaultSidebar","/hfc-pubsub/subscribing/Messages_compression":"defaultSidebar","/hfc-pubsub/subscribing/retry-policy":"defaultSidebar","/hfc-pubsub/subscribing/subscriptions":"defaultSidebar"},"docs":[{"unversionedId":"api/classes/Message","id":"api/classes/Message","isDocsHomePage":false,"title":"Class: Message","description":"Type parameters","source":"@site/docs/api/classes/Message.md","sourceDirName":"api/classes","slug":"/api/classes/Message","permalink":"/hfc-pubsub/api/classes/Message","editUrl":null,"version":"current","sidebar_label":"Message","sidebarPosition":0,"frontMatter":{"id":"Message","title":"Class: Message","sidebar_label":"Message","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/api/"},"next":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/api/classes/PubSubService"}},{"unversionedId":"api/classes/PubSubService","id":"api/classes/PubSubService","isDocsHomePage":false,"title":"Class: PubSubService","description":"Properties","source":"@site/docs/api/classes/PubSubService.md","sourceDirName":"api/classes","slug":"/api/classes/PubSubService","permalink":"/hfc-pubsub/api/classes/PubSubService","editUrl":null,"version":"current","sidebar_label":"PubSubService","sidebarPosition":0,"frontMatter":{"id":"PubSubService","title":"Class: PubSubService","sidebar_label":"PubSubService","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: Message","permalink":"/hfc-pubsub/api/classes/Message"},"next":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/api/classes/SubscriptionService"}},{"unversionedId":"api/classes/SubscriptionService","id":"api/classes/SubscriptionService","isDocsHomePage":false,"title":"Class: SubscriptionService","description":"Constructors","source":"@site/docs/api/classes/SubscriptionService.md","sourceDirName":"api/classes","slug":"/api/classes/SubscriptionService","permalink":"/hfc-pubsub/api/classes/SubscriptionService","editUrl":null,"version":"current","sidebar_label":"SubscriptionService","sidebarPosition":0,"frontMatter":{"id":"SubscriptionService","title":"Class: SubscriptionService","sidebar_label":"SubscriptionService","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/api/classes/PubSubService"},"next":{"title":"Class: Topic

","permalink":"/hfc-pubsub/api/classes/Topic"}},{"unversionedId":"api/classes/Topic","id":"api/classes/Topic","isDocsHomePage":false,"title":"Class: Topic

","description":"Type parameters","source":"@site/docs/api/classes/Topic.md","sourceDirName":"api/classes","slug":"/api/classes/Topic","permalink":"/hfc-pubsub/api/classes/Topic","editUrl":null,"version":"current","sidebar_label":"Topic","sidebarPosition":0,"frontMatter":{"id":"Topic","title":"Class: Topic

","sidebar_label":"Topic","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/api/classes/SubscriptionService"},"next":{"title":"Interface: Payload","permalink":"/hfc-pubsub/api/interfaces/Payload"}},{"unversionedId":"api/index","id":"api/index","isDocsHomePage":false,"title":"@honestfoodcompany/pubsub","description":"Classes","source":"@site/docs/api/index.md","sourceDirName":"api","slug":"/api/","permalink":"/hfc-pubsub/api/","editUrl":null,"version":"current","sidebar_label":"Exports","sidebarPosition":0.5,"frontMatter":{"id":"index","title":"@honestfoodcompany/pubsub","slug":"/api/","sidebar_label":"Exports","sidebar_position":0.5,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Other Options","permalink":"/hfc-pubsub/options"},"next":{"title":"Class: Message","permalink":"/hfc-pubsub/api/classes/Message"}},{"unversionedId":"api/interfaces/Payload","id":"api/interfaces/Payload","isDocsHomePage":false,"title":"Interface: Payload","description":"extend this interface to define your own payload","source":"@site/docs/api/interfaces/Payload.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Payload","permalink":"/hfc-pubsub/api/interfaces/Payload","editUrl":null,"version":"current","sidebar_label":"Payload","sidebarPosition":0,"frontMatter":{"id":"Payload","title":"Interface: Payload","sidebar_label":"Payload","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: Topic

","permalink":"/hfc-pubsub/api/classes/Topic"},"next":{"title":"Interface: SubscriberMetadata","permalink":"/hfc-pubsub/api/interfaces/SubscriberMetadata"}},{"unversionedId":"api/interfaces/SubscriberMetadata","id":"api/interfaces/SubscriberMetadata","isDocsHomePage":false,"title":"Interface: SubscriberMetadata","description":"Properties","source":"@site/docs/api/interfaces/SubscriberMetadata.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberMetadata","permalink":"/hfc-pubsub/api/interfaces/SubscriberMetadata","editUrl":null,"version":"current","sidebar_label":"SubscriberMetadata","sidebarPosition":0,"frontMatter":{"id":"SubscriberMetadata","title":"Interface: SubscriberMetadata","sidebar_label":"SubscriberMetadata","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: Payload","permalink":"/hfc-pubsub/api/interfaces/Payload"},"next":{"title":"Interface: SubscriberObject","permalink":"/hfc-pubsub/api/interfaces/SubscriberObject"}},{"unversionedId":"api/interfaces/SubscriberObject","id":"api/interfaces/SubscriberObject","isDocsHomePage":false,"title":"Interface: SubscriberObject","description":"Type parameters","source":"@site/docs/api/interfaces/SubscriberObject.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberObject","permalink":"/hfc-pubsub/api/interfaces/SubscriberObject","editUrl":null,"version":"current","sidebar_label":"SubscriberObject","sidebarPosition":0,"frontMatter":{"id":"SubscriberObject","title":"Interface: SubscriberObject","sidebar_label":"SubscriberObject","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: SubscriberMetadata","permalink":"/hfc-pubsub/api/interfaces/SubscriberMetadata"},"next":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/api/interfaces/SubscriberOptions"}},{"unversionedId":"api/interfaces/SubscriberOptions","id":"api/interfaces/SubscriberOptions","isDocsHomePage":false,"title":"Interface: SubscriberOptions","description":"Hierarchy","source":"@site/docs/api/interfaces/SubscriberOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberOptions","permalink":"/hfc-pubsub/api/interfaces/SubscriberOptions","editUrl":null,"version":"current","sidebar_label":"SubscriberOptions","sidebarPosition":0,"frontMatter":{"id":"SubscriberOptions","title":"Interface: SubscriberOptions","sidebar_label":"SubscriberOptions","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: SubscriberObject","permalink":"/hfc-pubsub/api/interfaces/SubscriberObject"},"next":{"title":"Interface: TopicOptions","permalink":"/hfc-pubsub/api/interfaces/TopicOptions"}},{"unversionedId":"api/interfaces/TopicOptions","id":"api/interfaces/TopicOptions","isDocsHomePage":false,"title":"Interface: TopicOptions","description":"Properties","source":"@site/docs/api/interfaces/TopicOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/TopicOptions","permalink":"/hfc-pubsub/api/interfaces/TopicOptions","editUrl":null,"version":"current","sidebar_label":"TopicOptions","sidebarPosition":0,"frontMatter":{"id":"TopicOptions","title":"Interface: TopicOptions","sidebar_label":"TopicOptions","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/api/interfaces/SubscriberOptions"},"next":{"title":"Changelog","permalink":"/hfc-pubsub/changelog"}},{"unversionedId":"changelog","id":"changelog","isDocsHomePage":false,"title":"Changelog","description":"2.2.2","source":"@site/docs/changelog.md","sourceDirName":".","slug":"/changelog","permalink":"/hfc-pubsub/changelog","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/changelog.md","version":"current","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Interface: TopicOptions","permalink":"/hfc-pubsub/api/interfaces/TopicOptions"}},{"unversionedId":"getting-started/installation","id":"getting-started/installation","isDocsHomePage":false,"title":"Installation","description":"Requirements","source":"@site/docs/getting-started/Installation.md","sourceDirName":"getting-started","slug":"/getting-started/installation","permalink":"/hfc-pubsub/getting-started/installation","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/getting-started/Installation.md","version":"current","sidebarPosition":1,"frontMatter":{"id":"installation","title":"Installation","slug":"/getting-started/installation","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Introduction","permalink":"/hfc-pubsub/"},"next":{"title":"Subscriptions","permalink":"/hfc-pubsub/subscribing/subscriptions"}},{"unversionedId":"guides/cli","id":"guides/cli","isDocsHomePage":false,"title":"CLI","description":"Prerequisites npm i -g npx","source":"@site/docs/guides/CLI.md","sourceDirName":"guides","slug":"/guides/cli","permalink":"/hfc-pubsub/guides/cli","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/CLI.md","version":"current","sidebarPosition":1,"frontMatter":{"id":"cli","title":"CLI","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Health Checks","permalink":"/hfc-pubsub/server/health-check"},"next":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/guides/drivers"}},{"unversionedId":"guides/drivers","id":"guides/drivers","isDocsHomePage":false,"title":"PubSub Drivers","description":"Google PubSub Driver","source":"@site/docs/guides/Drivers.md","sourceDirName":"guides","slug":"/guides/drivers","permalink":"/hfc-pubsub/guides/drivers","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/Drivers.md","version":"current","sidebarPosition":2,"frontMatter":{"id":"drivers","title":"PubSub Drivers","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"CLI","permalink":"/hfc-pubsub/guides/cli"},"next":{"title":"Migrating to v2","permalink":"/hfc-pubsub/guides/migrating-to-v2"}},{"unversionedId":"guides/migrating-to-v2","id":"guides/migrating-to-v2","isDocsHomePage":false,"title":"Migrating to v2","description":"We simplified and improved the experience of using PubSub Framework (especially for Typescript users) in v2, that meant changing the way we do a few things.","source":"@site/docs/guides/Migrating to v2.mdx","sourceDirName":"guides","slug":"/guides/migrating-to-v2","permalink":"/hfc-pubsub/guides/migrating-to-v2","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/Migrating to v2.mdx","version":"current","sidebarPosition":3,"frontMatter":{"id":"migrating-to-v2","title":"Migrating to v2","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/guides/drivers"},"next":{"title":"Testing","permalink":"/hfc-pubsub/guides/testing"}},{"unversionedId":"guides/testing","id":"guides/testing","isDocsHomePage":false,"title":"Testing","description":"Unit Tests","source":"@site/docs/guides/Testing.md","sourceDirName":"guides","slug":"/guides/testing","permalink":"/hfc-pubsub/guides/testing","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/Testing.md","version":"current","sidebarPosition":4,"frontMatter":{"id":"testing","title":"Testing","sidebar_position":4},"sidebar":"defaultSidebar","previous":{"title":"Migrating to v2","permalink":"/hfc-pubsub/guides/migrating-to-v2"},"next":{"title":"Other Options","permalink":"/hfc-pubsub/options"}},{"unversionedId":"introduction","id":"introduction","isDocsHomePage":false,"title":"Introduction","description":"@honestfoodcompany/pubsub","source":"@site/docs/Introduction.md","sourceDirName":".","slug":"/","permalink":"/hfc-pubsub/","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/Introduction.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"introduction","title":"Introduction","sidebar_position":0,"slug":"/"},"sidebar":"defaultSidebar","next":{"title":"Installation","permalink":"/hfc-pubsub/getting-started/installation"}},{"unversionedId":"options","id":"options","isDocsHomePage":false,"title":"Other Options","description":"","source":"@site/docs/Options.md","sourceDirName":".","slug":"/options","permalink":"/hfc-pubsub/options","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/Options.md","version":"current","sidebarPosition":6,"frontMatter":{"id":"options","title":"Other Options","sidebar_position":6},"sidebar":"defaultSidebar","previous":{"title":"Testing","permalink":"/hfc-pubsub/guides/testing"},"next":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/api/"}},{"unversionedId":"publishing/attributes","id":"publishing/attributes","isDocsHomePage":false,"title":"Publishing with Attributes","description":"See:","source":"@site/docs/publishing/Attributes.md","sourceDirName":"publishing","slug":"/publishing/attributes","permalink":"/hfc-pubsub/publishing/attributes","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Attributes.md","version":"current","sidebar_label":"Attributes","sidebarPosition":2,"frontMatter":{"id":"attributes","title":"Publishing with Attributes","sidebar_label":"Attributes","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/publishing/retry-settings"},"next":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/publishing/publish-diff-project"}},{"unversionedId":"publishing/publish-diff-project","id":"publishing/publish-diff-project","isDocsHomePage":false,"title":"Publishing on a Different GCP project","description":"`ts title=\\"/pubsub/topics/example-topic-with-custom-credentials.ts\\"","source":"@site/docs/publishing/Publish Diff Project.md","sourceDirName":"publishing","slug":"/publishing/publish-diff-project","permalink":"/hfc-pubsub/publishing/publish-diff-project","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Publish Diff Project.md","version":"current","sidebar_label":"Different GCP project","sidebarPosition":3,"frontMatter":{"id":"publish-diff-project","title":"Publishing on a Different GCP project","sidebar_label":"Different GCP project","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/publishing/attributes"},"next":{"title":"Subscription Service","permalink":"/hfc-pubsub/server/service"}},{"unversionedId":"publishing/retry-settings","id":"publishing/retry-settings","isDocsHomePage":false,"title":"Publishing a message with retry settings","description":"NOTE: This may not work right now, it is a known bug.","source":"@site/docs/publishing/Retry Settings.md","sourceDirName":"publishing","slug":"/publishing/retry-settings","permalink":"/hfc-pubsub/publishing/retry-settings","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Retry Settings.md","version":"current","sidebar_label":"Retry Settings","sidebarPosition":1,"frontMatter":{"id":"retry-settings","title":"Publishing a message with retry settings","sidebar_label":"Retry Settings","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Topics","permalink":"/hfc-pubsub/publishing/topics"},"next":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/publishing/attributes"}},{"unversionedId":"publishing/topics","id":"publishing/topics","isDocsHomePage":false,"title":"Topics","description":"Create a topic in PUBSUBROOTDIR/topics which extends Topic and a payload which extends Payload from package.","source":"@site/docs/publishing/Topics.md","sourceDirName":"publishing","slug":"/publishing/topics","permalink":"/hfc-pubsub/publishing/topics","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Topics.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"topics","title":"Topics","sidebar_position":0},"sidebar":"defaultSidebar","previous":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/subscribing/message-ordering"},"next":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/publishing/retry-settings"}},{"unversionedId":"server/connect-database","id":"server/connect-database","isDocsHomePage":false,"title":"Connecting to a Database","description":"It is recommended to initialize a database connection in the subscription.service file in your PUBSUBROOTDIR. Insert your database connection logic in the init method.","source":"@site/docs/server/Connect Database.md","sourceDirName":"server","slug":"/server/connect-database","permalink":"/hfc-pubsub/server/connect-database","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Connect Database.md","version":"current","sidebar_label":"Connect Database","sidebarPosition":2,"frontMatter":{"id":"connect-database","title":"Connecting to a Database","sidebar_label":"Connect Database","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/server/custom-logger"},"next":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/server/graceful-shutdown"}},{"unversionedId":"server/custom-logger","id":"server/custom-logger","isDocsHomePage":false,"title":"Passing a Custom Logger","description":"In the main SubscriptionService before defining subscription class you can update the logger that is being used by the package for logging. It\'s an optional definition and by default it uses console.* for logging .info, .warn and .error these 3 function keys are a must have for the logger you pass.","source":"@site/docs/server/Custom Logger.md","sourceDirName":"server","slug":"/server/custom-logger","permalink":"/hfc-pubsub/server/custom-logger","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Custom Logger.md","version":"current","sidebar_label":"Custom Logger","sidebarPosition":1,"frontMatter":{"id":"custom-logger","title":"Passing a Custom Logger","sidebar_label":"Custom Logger","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Subscription Service","permalink":"/hfc-pubsub/server/service"},"next":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/server/connect-database"}},{"unversionedId":"server/graceful-shutdown","id":"server/graceful-shutdown","isDocsHomePage":false,"title":"Graceful Shutdown","description":"When gracefully shutting down a process, it is a good idea to first close all open subscriptions and DB connections. For this reason we have a static closeAll method in the SubscriptionService that can close all connections before shutting down. An example using it with process signal handlers:","source":"@site/docs/server/Graceful Shutdown.md","sourceDirName":"server","slug":"/server/graceful-shutdown","permalink":"/hfc-pubsub/server/graceful-shutdown","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Graceful Shutdown.md","version":"current","sidebarPosition":3,"frontMatter":{"id":"graceful-shutdown","title":"Graceful Shutdown","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/server/connect-database"},"next":{"title":"Health Checks","permalink":"/hfc-pubsub/server/health-check"}},{"unversionedId":"server/health-check","id":"server/health-check","isDocsHomePage":false,"title":"Health Checks","description":"For health checks and readiness probes you can enable the inbuilt health check http server by setting the following environment variables (or corresponding CLI option) :","source":"@site/docs/server/Health Check.md","sourceDirName":"server","slug":"/server/health-check","permalink":"/hfc-pubsub/server/health-check","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Health Check.md","version":"current","sidebarPosition":4,"frontMatter":{"id":"health-check","title":"Health Checks","sidebar_position":4},"sidebar":"defaultSidebar","previous":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/server/graceful-shutdown"},"next":{"title":"CLI","permalink":"/hfc-pubsub/guides/cli"}},{"unversionedId":"server/service","id":"server/service","isDocsHomePage":false,"title":"Subscription Service","description":"Extend and customize the behavior of the subscription server in the subscription.service file. Initialize a database connection, register subscribers, and define default subscriber options in the subscription service file.","source":"@site/docs/server/Service.md","sourceDirName":"server","slug":"/server/service","permalink":"/hfc-pubsub/server/service","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Service.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"service","title":"Subscription Service","sidebar_position":0},"sidebar":"defaultSidebar","previous":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/publishing/publish-diff-project"},"next":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/server/custom-logger"}},{"unversionedId":"subscribing/dead-letter-policy","id":"subscribing/dead-letter-policy","isDocsHomePage":false,"title":"Subscriptions with a Dead-letter Policy","description":"It is possible to define a dead-letter policy for a subscription. If the dead letter topic does not exist, it will be created automatically by the framework.","source":"@site/docs/subscribing/Dead Letter Policy.md","sourceDirName":"subscribing","slug":"/subscribing/dead-letter-policy","permalink":"/hfc-pubsub/subscribing/dead-letter-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Dead Letter Policy.md","version":"current","sidebar_label":"Dead Letter Policy","sidebarPosition":1,"frontMatter":{"id":"dead-letter-policy","title":"Subscriptions with a Dead-letter Policy","sidebar_label":"Dead Letter Policy","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Subscriptions","permalink":"/hfc-pubsub/subscribing/subscriptions"},"next":{"title":"Messages compression","permalink":"/hfc-pubsub/subscribing/Messages_compression"}},{"unversionedId":"subscribing/error-handling","id":"subscribing/error-handling","isDocsHomePage":false,"title":"Internal Error Handling","description":"To handle any internal error that might occur on pubsub side, the method handleError can be declared either in Subscriber Object or in SubscriptionService.","source":"@site/docs/subscribing/Internal Error Handling.md","sourceDirName":"subscribing","slug":"/subscribing/error-handling","permalink":"/hfc-pubsub/subscribing/error-handling","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Internal Error Handling.md","version":"current","sidebar_label":"Error Handling","sidebarPosition":2,"frontMatter":{"id":"error-handling","title":"Internal Error Handling","sidebar_label":"Error Handling","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Messages compression","permalink":"/hfc-pubsub/subscribing/Messages_compression"},"next":{"title":"Adding Labels","permalink":"/hfc-pubsub/subscribing/labels"}},{"unversionedId":"subscribing/labels","id":"subscribing/labels","isDocsHomePage":false,"title":"Adding Labels","description":"Global Labels","source":"@site/docs/subscribing/Labels.md","sourceDirName":"subscribing","slug":"/subscribing/labels","permalink":"/hfc-pubsub/subscribing/labels","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Labels.md","version":"current","sidebar_label":"Labels","sidebarPosition":2,"frontMatter":{"id":"labels","title":"Adding Labels","sidebar_label":"Labels","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/subscribing/error-handling"},"next":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/subscribing/retry-policy"}},{"unversionedId":"subscribing/message-ordering","id":"subscribing/message-ordering","isDocsHomePage":false,"title":"Subscription with Message Ordering","description":"Messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.","source":"@site/docs/subscribing/Message Ordering.md","sourceDirName":"subscribing","slug":"/subscribing/message-ordering","permalink":"/hfc-pubsub/subscribing/message-ordering","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Message Ordering.md","version":"current","sidebar_label":"Message Ordering","sidebarPosition":3,"frontMatter":{"id":"message-ordering","title":"Subscription with Message Ordering","sidebar_label":"Message Ordering","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/subscribing/retry-policy"},"next":{"title":"Topics","permalink":"/hfc-pubsub/publishing/topics"}},{"unversionedId":"subscribing/Messages_compression","id":"subscribing/Messages_compression","isDocsHomePage":false,"title":"Messages compression","description":"Framework supports gzip compression/decompression for messages.","source":"@site/docs/subscribing/Messages Compression.md","sourceDirName":"subscribing","slug":"/subscribing/Messages_compression","permalink":"/hfc-pubsub/subscribing/Messages_compression","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Messages Compression.md","version":"current","sidebarPosition":1,"frontMatter":{"id":"Messages_compression","title":"Messages compression","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/subscribing/dead-letter-policy"},"next":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/subscribing/error-handling"}},{"unversionedId":"subscribing/retry-policy","id":"subscribing/retry-policy","isDocsHomePage":false,"title":"Subscriptions with Retry Policy","description":"It is possible to define a retry configuration for a subscription:","source":"@site/docs/subscribing/Retry Policy.md","sourceDirName":"subscribing","slug":"/subscribing/retry-policy","permalink":"/hfc-pubsub/subscribing/retry-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Retry Policy.md","version":"current","sidebar_label":"Retry Policy","sidebarPosition":2,"frontMatter":{"id":"retry-policy","title":"Subscriptions with Retry Policy","sidebar_label":"Retry Policy","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Adding Labels","permalink":"/hfc-pubsub/subscribing/labels"},"next":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/subscribing/message-ordering"}},{"unversionedId":"subscribing/subscriptions","id":"subscribing/subscriptions","isDocsHomePage":false,"title":"Subscriptions","description":"Create a Subscriber to define a message handler for messages that are published on the corresponding topic.","source":"@site/docs/subscribing/Subscriptions.md","sourceDirName":"subscribing","slug":"/subscribing/subscriptions","permalink":"/hfc-pubsub/subscribing/subscriptions","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Subscriptions.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"subscriptions","title":"Subscriptions","sidebar_position":0},"sidebar":"defaultSidebar","previous":{"title":"Installation","permalink":"/hfc-pubsub/getting-started/installation"},"next":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/subscribing/dead-letter-policy"}}]},{"versionName":"v1","versionLabel":"v1","versionPath":"/hfc-pubsub/v1","versionEditUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1","versionEditUrlLocalized":"https://github.com/deliveryhero/hfc-pubsub/edit/main/i18n/en/docusaurus-plugin-content-docs/version-v1","isLast":false,"sidebarFilePath":"/home/runner/work/hfc-pubsub/hfc-pubsub/versioned_sidebars/version-v1-sidebars.json","contentPath":"/home/runner/work/hfc-pubsub/hfc-pubsub/versioned_docs/version-v1","contentPathLocalized":"/home/runner/work/hfc-pubsub/hfc-pubsub/i18n/en/docusaurus-plugin-content-docs/version-v1","mainDocId":"introduction","sidebars":{"version-v1/defaultSidebar":[{"type":"doc","id":"version-v1/introduction"},{"type":"category","label":"Getting Started","items":[{"type":"doc","id":"version-v1/getting-started/installation"}],"collapsed":false},{"type":"category","label":"Subscribing","items":[{"type":"doc","id":"version-v1/subscribing/subscriptions"},{"type":"doc","id":"version-v1/subscribing/dead-letter-policy","label":"Dead Letter Policy"},{"type":"doc","id":"version-v1/subscribing/error-handling","label":"Error Handling"},{"type":"doc","id":"version-v1/subscribing/retry-policy","label":"Retry Policy"},{"type":"doc","id":"version-v1/subscribing/message-ordering","label":"Message Ordering"}],"collapsed":true},{"type":"category","label":"Publishing","items":[{"type":"doc","id":"version-v1/publishing/topics"},{"type":"doc","id":"version-v1/publishing/retry-settings","label":"Retry Settings"},{"type":"doc","id":"version-v1/publishing/attributes","label":"Attributes"},{"type":"doc","id":"version-v1/publishing/publish-diff-project","label":"Different GCP project"}],"collapsed":true},{"type":"category","label":"Server","items":[{"type":"doc","id":"version-v1/server/service"},{"type":"doc","id":"version-v1/server/custom-logger","label":"Custom Logger"},{"type":"doc","id":"version-v1/server/connect-database","label":"Connect Database"},{"type":"doc","id":"version-v1/server/graceful-shutdown"},{"type":"doc","id":"version-v1/server/health-check"}],"collapsed":true},{"type":"doc","id":"version-v1/cli"},{"type":"doc","id":"version-v1/drivers"},{"type":"doc","id":"version-v1/options"},{"type":"category","label":"Guides","items":[{"type":"doc","id":"version-v1/guides/testing"}],"collapsed":true},{"type":"category","label":"API","items":[{"type":"doc","id":"version-v1/api/index","label":"Exports"},{"type":"category","label":"Namespaces","items":[{"type":"doc","id":"version-v1/api/namespaces/Interfaces","label":"Interfaces"}],"collapsed":true},{"type":"category","label":"Classes","items":[{"type":"doc","id":"version-v1/api/classes/Message","label":"Message"},{"type":"doc","id":"version-v1/api/classes/PubSubService","label":"PubSubService"},{"type":"doc","id":"version-v1/api/classes/Subscriber","label":"Subscriber"},{"type":"doc","id":"version-v1/api/classes/SubscriptionService","label":"SubscriptionService"},{"type":"doc","id":"version-v1/api/classes/Topic","label":"Topic"}],"collapsed":true},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"version-v1/api/interfaces/Payload","label":"Payload"},{"type":"doc","id":"version-v1/api/interfaces/SubscriberOptions","label":"SubscriberOptions"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.BackoffSettings","label":"BackoffSettings"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.GooglePubSubProject","label":"GooglePubSubProject"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.PublishOptions","label":"PublishOptions"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.RetryConfig","label":"RetryConfig"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.TopicPublishOptions","label":"TopicPublishOptions"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.pubSubClient","label":"pubSubClient"}],"collapsed":true}],"collapsed":true}]},"permalinkToSidebar":{"/hfc-pubsub/v1/api/classes/Message":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/PubSubService":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/Subscriber":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/SubscriptionService":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/Topic":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.pubSubClient":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Payload":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/SubscriberOptions":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/namespaces/Interfaces":"version-v1/defaultSidebar","/hfc-pubsub/v1/cli":"version-v1/defaultSidebar","/hfc-pubsub/v1/drivers":"version-v1/defaultSidebar","/hfc-pubsub/v1/getting-started/installation":"version-v1/defaultSidebar","/hfc-pubsub/v1/guides/testing":"version-v1/defaultSidebar","/hfc-pubsub/v1/":"version-v1/defaultSidebar","/hfc-pubsub/v1/options":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/attributes":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/publish-diff-project":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/retry-settings":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/topics":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/connect-database":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/custom-logger":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/graceful-shutdown":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/health-check":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/service":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/dead-letter-policy":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/error-handling":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/message-ordering":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/retry-policy":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/subscriptions":"version-v1/defaultSidebar"},"docs":[{"unversionedId":"api/classes/Message","id":"version-v1/api/classes/Message","isDocsHomePage":false,"title":"Class: Message","description":"Constructors","source":"@site/versioned_docs/version-v1/api/classes/Message.md","sourceDirName":"api/classes","slug":"/api/classes/Message","permalink":"/hfc-pubsub/v1/api/classes/Message","editUrl":null,"version":"v1","sidebar_label":"Message","sidebarPosition":0,"frontMatter":{"id":"Message","title":"Class: Message","sidebar_label":"Message","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Namespace: Interfaces","permalink":"/hfc-pubsub/v1/api/namespaces/Interfaces"},"next":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/v1/api/classes/PubSubService"}},{"unversionedId":"api/classes/PubSubService","id":"version-v1/api/classes/PubSubService","isDocsHomePage":false,"title":"Class: PubSubService","description":"Constructors","source":"@site/versioned_docs/version-v1/api/classes/PubSubService.md","sourceDirName":"api/classes","slug":"/api/classes/PubSubService","permalink":"/hfc-pubsub/v1/api/classes/PubSubService","editUrl":null,"version":"v1","sidebar_label":"PubSubService","sidebarPosition":0,"frontMatter":{"id":"PubSubService","title":"Class: PubSubService","sidebar_label":"PubSubService","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: Message","permalink":"/hfc-pubsub/v1/api/classes/Message"},"next":{"title":"Class: Subscriber","permalink":"/hfc-pubsub/v1/api/classes/Subscriber"}},{"unversionedId":"api/classes/Subscriber","id":"version-v1/api/classes/Subscriber","isDocsHomePage":false,"title":"Class: Subscriber","description":"deprecated","source":"@site/versioned_docs/version-v1/api/classes/Subscriber.md","sourceDirName":"api/classes","slug":"/api/classes/Subscriber","permalink":"/hfc-pubsub/v1/api/classes/Subscriber","editUrl":null,"version":"v1","sidebar_label":"Subscriber","sidebarPosition":0,"frontMatter":{"id":"Subscriber","title":"Class: Subscriber","sidebar_label":"Subscriber","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/v1/api/classes/PubSubService"},"next":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/v1/api/classes/SubscriptionService"}},{"unversionedId":"api/classes/SubscriptionService","id":"version-v1/api/classes/SubscriptionService","isDocsHomePage":false,"title":"Class: SubscriptionService","description":"Constructors","source":"@site/versioned_docs/version-v1/api/classes/SubscriptionService.md","sourceDirName":"api/classes","slug":"/api/classes/SubscriptionService","permalink":"/hfc-pubsub/v1/api/classes/SubscriptionService","editUrl":null,"version":"v1","sidebar_label":"SubscriptionService","sidebarPosition":0,"frontMatter":{"id":"SubscriptionService","title":"Class: SubscriptionService","sidebar_label":"SubscriptionService","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: Subscriber","permalink":"/hfc-pubsub/v1/api/classes/Subscriber"},"next":{"title":"Class: Topic","permalink":"/hfc-pubsub/v1/api/classes/Topic"}},{"unversionedId":"api/classes/Topic","id":"version-v1/api/classes/Topic","isDocsHomePage":false,"title":"Class: Topic","description":"Implements","source":"@site/versioned_docs/version-v1/api/classes/Topic.md","sourceDirName":"api/classes","slug":"/api/classes/Topic","permalink":"/hfc-pubsub/v1/api/classes/Topic","editUrl":null,"version":"v1","sidebar_label":"Topic","sidebarPosition":0,"frontMatter":{"id":"Topic","title":"Class: Topic","sidebar_label":"Topic","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/v1/api/classes/SubscriptionService"},"next":{"title":"Interface: Payload","permalink":"/hfc-pubsub/v1/api/interfaces/Payload"}},{"unversionedId":"api/index","id":"version-v1/api/index","isDocsHomePage":false,"title":"@honestfoodcompany/pubsub","description":"Namespaces","source":"@site/versioned_docs/version-v1/api/index.md","sourceDirName":"api","slug":"/api/","permalink":"/hfc-pubsub/v1/api/","editUrl":null,"version":"v1","sidebar_label":"Exports","sidebarPosition":0.5,"frontMatter":{"id":"index","title":"@honestfoodcompany/pubsub","slug":"/api/","sidebar_label":"Exports","sidebar_position":0.5,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Testing","permalink":"/hfc-pubsub/v1/guides/testing"},"next":{"title":"Namespace: Interfaces","permalink":"/hfc-pubsub/v1/api/namespaces/Interfaces"}},{"unversionedId":"api/interfaces/Interfaces.BackoffSettings","id":"version-v1/api/interfaces/Interfaces.BackoffSettings","isDocsHomePage":false,"title":"Interface: BackoffSettings","description":"Interfaces.BackoffSettings","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.BackoffSettings.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.BackoffSettings","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings","editUrl":null,"version":"v1","sidebar_label":"BackoffSettings","frontMatter":{"id":"Interfaces.BackoffSettings","title":"Interface: BackoffSettings","sidebar_label":"BackoffSettings","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/v1/api/interfaces/SubscriberOptions"},"next":{"title":"Interface: GooglePubSubProject","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject"}},{"unversionedId":"api/interfaces/Interfaces.GooglePubSubProject","id":"version-v1/api/interfaces/Interfaces.GooglePubSubProject","isDocsHomePage":false,"title":"Interface: GooglePubSubProject","description":"Interfaces.GooglePubSubProject","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.GooglePubSubProject.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.GooglePubSubProject","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject","editUrl":null,"version":"v1","sidebar_label":"GooglePubSubProject","frontMatter":{"id":"Interfaces.GooglePubSubProject","title":"Interface: GooglePubSubProject","sidebar_label":"GooglePubSubProject","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: BackoffSettings","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings"},"next":{"title":"Interface: PublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions"}},{"unversionedId":"api/interfaces/Interfaces.PublishOptions","id":"version-v1/api/interfaces/Interfaces.PublishOptions","isDocsHomePage":false,"title":"Interface: PublishOptions","description":"Interfaces.PublishOptions","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.PublishOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.PublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions","editUrl":null,"version":"v1","sidebar_label":"PublishOptions","frontMatter":{"id":"Interfaces.PublishOptions","title":"Interface: PublishOptions","sidebar_label":"PublishOptions","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: GooglePubSubProject","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject"},"next":{"title":"Interface: RetryConfig","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig"}},{"unversionedId":"api/interfaces/Interfaces.pubSubClient","id":"version-v1/api/interfaces/Interfaces.pubSubClient","isDocsHomePage":false,"title":"Interface: pubSubClient","description":"Interfaces.pubSubClient","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.pubSubClient.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.pubSubClient","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.pubSubClient","editUrl":null,"version":"v1","sidebar_label":"pubSubClient","frontMatter":{"id":"Interfaces.pubSubClient","title":"Interface: pubSubClient","sidebar_label":"pubSubClient","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: TopicPublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions"}},{"unversionedId":"api/interfaces/Interfaces.RetryConfig","id":"version-v1/api/interfaces/Interfaces.RetryConfig","isDocsHomePage":false,"title":"Interface: RetryConfig","description":"Interfaces.RetryConfig","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.RetryConfig.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.RetryConfig","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig","editUrl":null,"version":"v1","sidebar_label":"RetryConfig","frontMatter":{"id":"Interfaces.RetryConfig","title":"Interface: RetryConfig","sidebar_label":"RetryConfig","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: PublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions"},"next":{"title":"Interface: TopicPublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions"}},{"unversionedId":"api/interfaces/Interfaces.TopicPublishOptions","id":"version-v1/api/interfaces/Interfaces.TopicPublishOptions","isDocsHomePage":false,"title":"Interface: TopicPublishOptions","description":"Interfaces.TopicPublishOptions","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.TopicPublishOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.TopicPublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions","editUrl":null,"version":"v1","sidebar_label":"TopicPublishOptions","frontMatter":{"id":"Interfaces.TopicPublishOptions","title":"Interface: TopicPublishOptions","sidebar_label":"TopicPublishOptions","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: RetryConfig","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig"},"next":{"title":"Interface: pubSubClient","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.pubSubClient"}},{"unversionedId":"api/interfaces/Payload","id":"version-v1/api/interfaces/Payload","isDocsHomePage":false,"title":"Interface: Payload","description":"extend this interface to define your own payload","source":"@site/versioned_docs/version-v1/api/interfaces/Payload.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Payload","permalink":"/hfc-pubsub/v1/api/interfaces/Payload","editUrl":null,"version":"v1","sidebar_label":"Payload","sidebarPosition":0,"frontMatter":{"id":"Payload","title":"Interface: Payload","sidebar_label":"Payload","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: Topic","permalink":"/hfc-pubsub/v1/api/classes/Topic"},"next":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/v1/api/interfaces/SubscriberOptions"}},{"unversionedId":"api/interfaces/SubscriberOptions","id":"version-v1/api/interfaces/SubscriberOptions","isDocsHomePage":false,"title":"Interface: SubscriberOptions","description":"Hierarchy","source":"@site/versioned_docs/version-v1/api/interfaces/SubscriberOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberOptions","permalink":"/hfc-pubsub/v1/api/interfaces/SubscriberOptions","editUrl":null,"version":"v1","sidebar_label":"SubscriberOptions","sidebarPosition":0,"frontMatter":{"id":"SubscriberOptions","title":"Interface: SubscriberOptions","sidebar_label":"SubscriberOptions","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: Payload","permalink":"/hfc-pubsub/v1/api/interfaces/Payload"},"next":{"title":"Interface: BackoffSettings","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings"}},{"unversionedId":"api/namespaces/Interfaces","id":"version-v1/api/namespaces/Interfaces","isDocsHomePage":false,"title":"Namespace: Interfaces","description":"Interfaces","source":"@site/versioned_docs/version-v1/api/namespaces/Interfaces.md","sourceDirName":"api/namespaces","slug":"/api/namespaces/Interfaces","permalink":"/hfc-pubsub/v1/api/namespaces/Interfaces","editUrl":null,"version":"v1","sidebar_label":"Interfaces","sidebarPosition":0,"frontMatter":{"id":"Interfaces","title":"Namespace: Interfaces","sidebar_label":"Interfaces","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/v1/api/"},"next":{"title":"Class: Message","permalink":"/hfc-pubsub/v1/api/classes/Message"}},{"unversionedId":"cli","id":"version-v1/cli","isDocsHomePage":false,"title":"CLI","description":"Prerequisites npm i -g npx","source":"@site/versioned_docs/version-v1/CLI.md","sourceDirName":".","slug":"/cli","permalink":"/hfc-pubsub/v1/cli","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/CLI.md","version":"v1","sidebarPosition":5,"frontMatter":{"id":"cli","title":"CLI","sidebar_position":5},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Health Checks","permalink":"/hfc-pubsub/v1/server/health-check"},"next":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/v1/drivers"}},{"unversionedId":"drivers","id":"version-v1/drivers","isDocsHomePage":false,"title":"PubSub Drivers","description":"Google PubSub Driver","source":"@site/versioned_docs/version-v1/Drivers.md","sourceDirName":".","slug":"/drivers","permalink":"/hfc-pubsub/v1/drivers","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/Drivers.md","version":"v1","sidebarPosition":5,"frontMatter":{"id":"drivers","title":"PubSub Drivers","sidebar_position":5},"sidebar":"version-v1/defaultSidebar","previous":{"title":"CLI","permalink":"/hfc-pubsub/v1/cli"},"next":{"title":"Other Options","permalink":"/hfc-pubsub/v1/options"}},{"unversionedId":"getting-started/installation","id":"version-v1/getting-started/installation","isDocsHomePage":false,"title":"Installation","description":"Requirements","source":"@site/versioned_docs/version-v1/getting-started/Installation.md","sourceDirName":"getting-started","slug":"/getting-started/installation","permalink":"/hfc-pubsub/v1/getting-started/installation","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/getting-started/Installation.md","version":"v1","sidebarPosition":1,"frontMatter":{"id":"installation","title":"Installation","slug":"/getting-started/installation","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Introduction","permalink":"/hfc-pubsub/v1/"},"next":{"title":"Subscriptions","permalink":"/hfc-pubsub/v1/subscribing/subscriptions"}},{"unversionedId":"guides/testing","id":"version-v1/guides/testing","isDocsHomePage":false,"title":"Testing","description":"Unit Tests","source":"@site/versioned_docs/version-v1/guides/Testing.md","sourceDirName":"guides","slug":"/guides/testing","permalink":"/hfc-pubsub/v1/guides/testing","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/guides/Testing.md","version":"v1","sidebarPosition":2,"frontMatter":{"id":"testing","title":"Testing","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Other Options","permalink":"/hfc-pubsub/v1/options"},"next":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/v1/api/"}},{"unversionedId":"introduction","id":"version-v1/introduction","isDocsHomePage":false,"title":"Introduction","description":"@honestfoodcompany/pubsub","source":"@site/versioned_docs/version-v1/Introduction.md","sourceDirName":".","slug":"/","permalink":"/hfc-pubsub/v1/","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/Introduction.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"introduction","title":"Introduction","sidebar_position":0,"slug":"/"},"sidebar":"version-v1/defaultSidebar","next":{"title":"Installation","permalink":"/hfc-pubsub/v1/getting-started/installation"}},{"unversionedId":"options","id":"version-v1/options","isDocsHomePage":false,"title":"Other Options","description":"Enabling gRPC C++ bindings","source":"@site/versioned_docs/version-v1/Options.md","sourceDirName":".","slug":"/options","permalink":"/hfc-pubsub/v1/options","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/Options.md","version":"v1","sidebarPosition":6,"frontMatter":{"id":"options","title":"Other Options","sidebar_position":6},"sidebar":"version-v1/defaultSidebar","previous":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/v1/drivers"},"next":{"title":"Testing","permalink":"/hfc-pubsub/v1/guides/testing"}},{"unversionedId":"publishing/attributes","id":"version-v1/publishing/attributes","isDocsHomePage":false,"title":"Publishing with Attributes","description":"See:","source":"@site/versioned_docs/version-v1/publishing/Attributes.md","sourceDirName":"publishing","slug":"/publishing/attributes","permalink":"/hfc-pubsub/v1/publishing/attributes","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Attributes.md","version":"v1","sidebar_label":"Attributes","sidebarPosition":2,"frontMatter":{"id":"attributes","title":"Publishing with Attributes","sidebar_label":"Attributes","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/v1/publishing/retry-settings"},"next":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/v1/publishing/publish-diff-project"}},{"unversionedId":"publishing/publish-diff-project","id":"version-v1/publishing/publish-diff-project","isDocsHomePage":false,"title":"Publishing on a Different GCP project","description":"`ts title=\\"/pubsub/topics/example-topic-with-customCredentials.ts\\"","source":"@site/versioned_docs/version-v1/publishing/Publish Diff Project.md","sourceDirName":"publishing","slug":"/publishing/publish-diff-project","permalink":"/hfc-pubsub/v1/publishing/publish-diff-project","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Publish Diff Project.md","version":"v1","sidebar_label":"Different GCP project","sidebarPosition":3,"frontMatter":{"id":"publish-diff-project","title":"Publishing on a Different GCP project","sidebar_label":"Different GCP project","sidebar_position":3},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/v1/publishing/attributes"},"next":{"title":"Subscription Service","permalink":"/hfc-pubsub/v1/server/service"}},{"unversionedId":"publishing/retry-settings","id":"version-v1/publishing/retry-settings","isDocsHomePage":false,"title":"Publishing a message with retry settings","description":"NOTE: This may not work right now, it is a known bug.","source":"@site/versioned_docs/version-v1/publishing/Retry Settings.md","sourceDirName":"publishing","slug":"/publishing/retry-settings","permalink":"/hfc-pubsub/v1/publishing/retry-settings","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Retry Settings.md","version":"v1","sidebar_label":"Retry Settings","sidebarPosition":1,"frontMatter":{"id":"retry-settings","title":"Publishing a message with retry settings","sidebar_label":"Retry Settings","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Topics","permalink":"/hfc-pubsub/v1/publishing/topics"},"next":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/v1/publishing/attributes"}},{"unversionedId":"publishing/topics","id":"version-v1/publishing/topics","isDocsHomePage":false,"title":"Topics","description":"Create a topic in PUBSUBROOTDIR/topics which extends Topic and a payload which extends Payload from package.","source":"@site/versioned_docs/version-v1/publishing/Topics.md","sourceDirName":"publishing","slug":"/publishing/topics","permalink":"/hfc-pubsub/v1/publishing/topics","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Topics.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"topics","title":"Topics","sidebar_position":0},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/v1/subscribing/message-ordering"},"next":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/v1/publishing/retry-settings"}},{"unversionedId":"server/connect-database","id":"version-v1/server/connect-database","isDocsHomePage":false,"title":"Connecting to a Database","description":"It is recommended to initialize a database connection in the subscription.service file in your PUBSUBROOTDIR. Insert your database connection logic in the init method.","source":"@site/versioned_docs/version-v1/server/Connect Database.md","sourceDirName":"server","slug":"/server/connect-database","permalink":"/hfc-pubsub/v1/server/connect-database","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Connect Database.md","version":"v1","sidebar_label":"Connect Database","sidebarPosition":2,"frontMatter":{"id":"connect-database","title":"Connecting to a Database","sidebar_label":"Connect Database","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/v1/server/custom-logger"},"next":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/v1/server/graceful-shutdown"}},{"unversionedId":"server/custom-logger","id":"version-v1/server/custom-logger","isDocsHomePage":false,"title":"Passing a Custom Logger","description":"In the main SubscriptionService before defining subscription class you can update the logger that is being used by the package for logging. It\'s an optional definition and by default it uses console.* for logging .info, .warn and .error these 3 function keys are a must have for the logger you pass.","source":"@site/versioned_docs/version-v1/server/Custom Logger.md","sourceDirName":"server","slug":"/server/custom-logger","permalink":"/hfc-pubsub/v1/server/custom-logger","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Custom Logger.md","version":"v1","sidebar_label":"Custom Logger","sidebarPosition":1,"frontMatter":{"id":"custom-logger","title":"Passing a Custom Logger","sidebar_label":"Custom Logger","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscription Service","permalink":"/hfc-pubsub/v1/server/service"},"next":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/v1/server/connect-database"}},{"unversionedId":"server/graceful-shutdown","id":"version-v1/server/graceful-shutdown","isDocsHomePage":false,"title":"Graceful Shutdown","description":"When gracefully shutting down a process, it is a good idea to first close all open subscriptions and DB connections. For this reason we have a static closeAll method in the SubscriptionService that can close all connections before shutting down. An example using it with process signal handlers:","source":"@site/versioned_docs/version-v1/server/Graceful Shutdown.md","sourceDirName":"server","slug":"/server/graceful-shutdown","permalink":"/hfc-pubsub/v1/server/graceful-shutdown","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Graceful Shutdown.md","version":"v1","sidebarPosition":3,"frontMatter":{"id":"graceful-shutdown","title":"Graceful Shutdown","sidebar_position":3},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/v1/server/connect-database"},"next":{"title":"Health Checks","permalink":"/hfc-pubsub/v1/server/health-check"}},{"unversionedId":"server/health-check","id":"version-v1/server/health-check","isDocsHomePage":false,"title":"Health Checks","description":"For health checks and readiness probes you can enable the inbuilt health check http server by setting the following environemnt variables (or corresponding CLI option) :","source":"@site/versioned_docs/version-v1/server/Health Check.md","sourceDirName":"server","slug":"/server/health-check","permalink":"/hfc-pubsub/v1/server/health-check","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Health Check.md","version":"v1","sidebarPosition":4,"frontMatter":{"id":"health-check","title":"Health Checks","sidebar_position":4},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/v1/server/graceful-shutdown"},"next":{"title":"CLI","permalink":"/hfc-pubsub/v1/cli"}},{"unversionedId":"server/service","id":"version-v1/server/service","isDocsHomePage":false,"title":"Subscription Service","description":"Extend and customize the behavior of the subscription server in the subscription.service file. Initialize a database connection, register subscribers, and define default subscriber options in the subscription service file.","source":"@site/versioned_docs/version-v1/server/Service.md","sourceDirName":"server","slug":"/server/service","permalink":"/hfc-pubsub/v1/server/service","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Service.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"service","title":"Subscription Service","sidebar_position":0},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/v1/publishing/publish-diff-project"},"next":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/v1/server/custom-logger"}},{"unversionedId":"subscribing/dead-letter-policy","id":"version-v1/subscribing/dead-letter-policy","isDocsHomePage":false,"title":"Subscriptions with a Dead-letter Policy","description":"It is possible to define a dead-letter policy for a subscription. If the dead letter topic does not exist, it will be created automatically by the framework.","source":"@site/versioned_docs/version-v1/subscribing/Dead Letter Policy.md","sourceDirName":"subscribing","slug":"/subscribing/dead-letter-policy","permalink":"/hfc-pubsub/v1/subscribing/dead-letter-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Dead Letter Policy.md","version":"v1","sidebar_label":"Dead Letter Policy","sidebarPosition":1,"frontMatter":{"id":"dead-letter-policy","title":"Subscriptions with a Dead-letter Policy","sidebar_label":"Dead Letter Policy","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscriptions","permalink":"/hfc-pubsub/v1/subscribing/subscriptions"},"next":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/v1/subscribing/error-handling"}},{"unversionedId":"subscribing/error-handling","id":"version-v1/subscribing/error-handling","isDocsHomePage":false,"title":"Internal Error Handling","description":"To handle any internal error that might occur on pubsub side, a the method handleError can be declared either in Subscriber Object or in SubscriptionService level.","source":"@site/versioned_docs/version-v1/subscribing/Internal Error Handling.md","sourceDirName":"subscribing","slug":"/subscribing/error-handling","permalink":"/hfc-pubsub/v1/subscribing/error-handling","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Internal Error Handling.md","version":"v1","sidebar_label":"Error Handling","sidebarPosition":2,"frontMatter":{"id":"error-handling","title":"Internal Error Handling","sidebar_label":"Error Handling","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/v1/subscribing/dead-letter-policy"},"next":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/v1/subscribing/retry-policy"}},{"unversionedId":"subscribing/message-ordering","id":"version-v1/subscribing/message-ordering","isDocsHomePage":false,"title":"Subscription with Message Ordering","description":"Messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.","source":"@site/versioned_docs/version-v1/subscribing/Message Ordering.md","sourceDirName":"subscribing","slug":"/subscribing/message-ordering","permalink":"/hfc-pubsub/v1/subscribing/message-ordering","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Message Ordering.md","version":"v1","sidebar_label":"Message Ordering","sidebarPosition":3,"frontMatter":{"id":"message-ordering","title":"Subscription with Message Ordering","sidebar_label":"Message Ordering","sidebar_position":3},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/v1/subscribing/retry-policy"},"next":{"title":"Topics","permalink":"/hfc-pubsub/v1/publishing/topics"}},{"unversionedId":"subscribing/retry-policy","id":"version-v1/subscribing/retry-policy","isDocsHomePage":false,"title":"Subscriptions with Retry Policy","description":"It is possible to define a retry configuration for a subscription:","source":"@site/versioned_docs/version-v1/subscribing/Retry Policy.md","sourceDirName":"subscribing","slug":"/subscribing/retry-policy","permalink":"/hfc-pubsub/v1/subscribing/retry-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Retry Policy.md","version":"v1","sidebar_label":"Retry Policy","sidebarPosition":2,"frontMatter":{"id":"retry-policy","title":"Subscriptions with Retry Policy","sidebar_label":"Retry Policy","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/v1/subscribing/error-handling"},"next":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/v1/subscribing/message-ordering"}},{"unversionedId":"subscribing/subscriptions","id":"version-v1/subscribing/subscriptions","isDocsHomePage":false,"title":"Subscriptions","description":"Create a Subscriber to define a message handler for messages that are published on the corresponding topic.","source":"@site/versioned_docs/version-v1/subscribing/Subscriptions.md","sourceDirName":"subscribing","slug":"/subscribing/subscriptions","permalink":"/hfc-pubsub/v1/subscribing/subscriptions","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Subscriptions.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"subscriptions","title":"Subscriptions","sidebar_position":0},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Installation","permalink":"/hfc-pubsub/v1/getting-started/installation"},"next":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/v1/subscribing/dead-letter-policy"}}]}]}},"docusaurus-plugin-content-blog":{"default":null},"docusaurus-plugin-content-pages":{"default":null},"docusaurus-plugin-debug":{"default":null},"docusaurus-plugin-sitemap":{"default":null},"docusaurus-theme-classic":{"default":null},"undefined":{"default":null}}')}}]); \ No newline at end of file diff --git a/assets/js/246f2c6f.d8eef432.js b/assets/js/246f2c6f.d8eef432.js deleted file mode 100644 index 242923cf..00000000 --- a/assets/js/246f2c6f.d8eef432.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[9285],{6267:e=>{e.exports=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"loadedVersions":[{"versionName":"current","versionLabel":"v2","versionPath":"/hfc-pubsub/","versionEditUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs","versionEditUrlLocalized":"https://github.com/deliveryhero/hfc-pubsub/edit/main/i18n/en/docusaurus-plugin-content-docs/current","isLast":true,"routePriority":-1,"contentPath":"/home/runner/work/hfc-pubsub/hfc-pubsub/docs","contentPathLocalized":"/home/runner/work/hfc-pubsub/hfc-pubsub/i18n/en/docusaurus-plugin-content-docs/current","mainDocId":"introduction","sidebars":{"defaultSidebar":[{"type":"doc","id":"introduction"},{"type":"category","label":"Getting Started","items":[{"type":"doc","id":"getting-started/installation"}],"collapsed":false},{"type":"category","label":"Subscribing","items":[{"type":"doc","id":"subscribing/subscriptions"},{"type":"doc","id":"subscribing/dead-letter-policy","label":"Dead Letter Policy"},{"type":"doc","id":"subscribing/Messages_compression"},{"type":"doc","id":"subscribing/error-handling","label":"Error Handling"},{"type":"doc","id":"subscribing/labels","label":"Labels"},{"type":"doc","id":"subscribing/retry-policy","label":"Retry Policy"},{"type":"doc","id":"subscribing/message-ordering","label":"Message Ordering"}],"collapsed":true},{"type":"category","label":"Publishing","items":[{"type":"doc","id":"publishing/topics"},{"type":"doc","id":"publishing/retry-settings","label":"Retry Settings"},{"type":"doc","id":"publishing/attributes","label":"Attributes"},{"type":"doc","id":"publishing/publish-diff-project","label":"Different GCP project"}],"collapsed":true},{"type":"category","label":"Server","items":[{"type":"doc","id":"server/service"},{"type":"doc","id":"server/custom-logger","label":"Custom Logger"},{"type":"doc","id":"server/connect-database","label":"Connect Database"},{"type":"doc","id":"server/graceful-shutdown"},{"type":"doc","id":"server/health-check"}],"collapsed":true},{"type":"category","label":"Guides","items":[{"type":"doc","id":"guides/cli"},{"type":"doc","id":"guides/drivers"},{"type":"doc","id":"guides/migrating-to-v2"},{"type":"doc","id":"guides/testing"}],"collapsed":true},{"type":"doc","id":"options"},{"type":"category","label":"API","items":[{"type":"doc","id":"api/index","label":"Exports"},{"type":"category","label":"Classes","items":[{"type":"doc","id":"api/classes/Message","label":"Message"},{"type":"doc","id":"api/classes/PubSubService","label":"PubSubService"},{"type":"doc","id":"api/classes/SubscriptionService","label":"SubscriptionService"},{"type":"doc","id":"api/classes/Topic","label":"Topic"}],"collapsed":true},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"api/interfaces/Payload","label":"Payload"},{"type":"doc","id":"api/interfaces/SubscriberMetadata","label":"SubscriberMetadata"},{"type":"doc","id":"api/interfaces/SubscriberObject","label":"SubscriberObject"},{"type":"doc","id":"api/interfaces/SubscriberOptions","label":"SubscriberOptions"},{"type":"doc","id":"api/interfaces/TopicOptions","label":"TopicOptions"}],"collapsed":true}],"collapsed":true},{"type":"doc","id":"changelog"}]},"permalinkToSidebar":{"/hfc-pubsub/api/classes/Message":"defaultSidebar","/hfc-pubsub/api/classes/PubSubService":"defaultSidebar","/hfc-pubsub/api/classes/SubscriptionService":"defaultSidebar","/hfc-pubsub/api/classes/Topic":"defaultSidebar","/hfc-pubsub/api/":"defaultSidebar","/hfc-pubsub/api/interfaces/Payload":"defaultSidebar","/hfc-pubsub/api/interfaces/SubscriberMetadata":"defaultSidebar","/hfc-pubsub/api/interfaces/SubscriberObject":"defaultSidebar","/hfc-pubsub/api/interfaces/SubscriberOptions":"defaultSidebar","/hfc-pubsub/api/interfaces/TopicOptions":"defaultSidebar","/hfc-pubsub/changelog":"defaultSidebar","/hfc-pubsub/getting-started/installation":"defaultSidebar","/hfc-pubsub/guides/cli":"defaultSidebar","/hfc-pubsub/guides/drivers":"defaultSidebar","/hfc-pubsub/guides/migrating-to-v2":"defaultSidebar","/hfc-pubsub/guides/testing":"defaultSidebar","/hfc-pubsub/":"defaultSidebar","/hfc-pubsub/options":"defaultSidebar","/hfc-pubsub/publishing/attributes":"defaultSidebar","/hfc-pubsub/publishing/publish-diff-project":"defaultSidebar","/hfc-pubsub/publishing/retry-settings":"defaultSidebar","/hfc-pubsub/publishing/topics":"defaultSidebar","/hfc-pubsub/server/connect-database":"defaultSidebar","/hfc-pubsub/server/custom-logger":"defaultSidebar","/hfc-pubsub/server/graceful-shutdown":"defaultSidebar","/hfc-pubsub/server/health-check":"defaultSidebar","/hfc-pubsub/server/service":"defaultSidebar","/hfc-pubsub/subscribing/dead-letter-policy":"defaultSidebar","/hfc-pubsub/subscribing/error-handling":"defaultSidebar","/hfc-pubsub/subscribing/labels":"defaultSidebar","/hfc-pubsub/subscribing/message-ordering":"defaultSidebar","/hfc-pubsub/subscribing/Messages_compression":"defaultSidebar","/hfc-pubsub/subscribing/retry-policy":"defaultSidebar","/hfc-pubsub/subscribing/subscriptions":"defaultSidebar"},"docs":[{"unversionedId":"api/classes/Message","id":"api/classes/Message","isDocsHomePage":false,"title":"Class: Message","description":"Type parameters","source":"@site/docs/api/classes/Message.md","sourceDirName":"api/classes","slug":"/api/classes/Message","permalink":"/hfc-pubsub/api/classes/Message","editUrl":null,"version":"current","sidebar_label":"Message","sidebarPosition":0,"frontMatter":{"id":"Message","title":"Class: Message","sidebar_label":"Message","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/api/"},"next":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/api/classes/PubSubService"}},{"unversionedId":"api/classes/PubSubService","id":"api/classes/PubSubService","isDocsHomePage":false,"title":"Class: PubSubService","description":"Properties","source":"@site/docs/api/classes/PubSubService.md","sourceDirName":"api/classes","slug":"/api/classes/PubSubService","permalink":"/hfc-pubsub/api/classes/PubSubService","editUrl":null,"version":"current","sidebar_label":"PubSubService","sidebarPosition":0,"frontMatter":{"id":"PubSubService","title":"Class: PubSubService","sidebar_label":"PubSubService","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: Message","permalink":"/hfc-pubsub/api/classes/Message"},"next":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/api/classes/SubscriptionService"}},{"unversionedId":"api/classes/SubscriptionService","id":"api/classes/SubscriptionService","isDocsHomePage":false,"title":"Class: SubscriptionService","description":"Constructors","source":"@site/docs/api/classes/SubscriptionService.md","sourceDirName":"api/classes","slug":"/api/classes/SubscriptionService","permalink":"/hfc-pubsub/api/classes/SubscriptionService","editUrl":null,"version":"current","sidebar_label":"SubscriptionService","sidebarPosition":0,"frontMatter":{"id":"SubscriptionService","title":"Class: SubscriptionService","sidebar_label":"SubscriptionService","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/api/classes/PubSubService"},"next":{"title":"Class: Topic

","permalink":"/hfc-pubsub/api/classes/Topic"}},{"unversionedId":"api/classes/Topic","id":"api/classes/Topic","isDocsHomePage":false,"title":"Class: Topic

","description":"Type parameters","source":"@site/docs/api/classes/Topic.md","sourceDirName":"api/classes","slug":"/api/classes/Topic","permalink":"/hfc-pubsub/api/classes/Topic","editUrl":null,"version":"current","sidebar_label":"Topic","sidebarPosition":0,"frontMatter":{"id":"Topic","title":"Class: Topic

","sidebar_label":"Topic","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/api/classes/SubscriptionService"},"next":{"title":"Interface: Payload","permalink":"/hfc-pubsub/api/interfaces/Payload"}},{"unversionedId":"api/index","id":"api/index","isDocsHomePage":false,"title":"@honestfoodcompany/pubsub","description":"Classes","source":"@site/docs/api/index.md","sourceDirName":"api","slug":"/api/","permalink":"/hfc-pubsub/api/","editUrl":null,"version":"current","sidebar_label":"Exports","sidebarPosition":0.5,"frontMatter":{"id":"index","title":"@honestfoodcompany/pubsub","slug":"/api/","sidebar_label":"Exports","sidebar_position":0.5,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Other Options","permalink":"/hfc-pubsub/options"},"next":{"title":"Class: Message","permalink":"/hfc-pubsub/api/classes/Message"}},{"unversionedId":"api/interfaces/Payload","id":"api/interfaces/Payload","isDocsHomePage":false,"title":"Interface: Payload","description":"extend this interface to define your own payload","source":"@site/docs/api/interfaces/Payload.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Payload","permalink":"/hfc-pubsub/api/interfaces/Payload","editUrl":null,"version":"current","sidebar_label":"Payload","sidebarPosition":0,"frontMatter":{"id":"Payload","title":"Interface: Payload","sidebar_label":"Payload","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Class: Topic

","permalink":"/hfc-pubsub/api/classes/Topic"},"next":{"title":"Interface: SubscriberMetadata","permalink":"/hfc-pubsub/api/interfaces/SubscriberMetadata"}},{"unversionedId":"api/interfaces/SubscriberMetadata","id":"api/interfaces/SubscriberMetadata","isDocsHomePage":false,"title":"Interface: SubscriberMetadata","description":"Hierarchy","source":"@site/docs/api/interfaces/SubscriberMetadata.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberMetadata","permalink":"/hfc-pubsub/api/interfaces/SubscriberMetadata","editUrl":null,"version":"current","sidebar_label":"SubscriberMetadata","sidebarPosition":0,"frontMatter":{"id":"SubscriberMetadata","title":"Interface: SubscriberMetadata","sidebar_label":"SubscriberMetadata","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: Payload","permalink":"/hfc-pubsub/api/interfaces/Payload"},"next":{"title":"Interface: SubscriberObject","permalink":"/hfc-pubsub/api/interfaces/SubscriberObject"}},{"unversionedId":"api/interfaces/SubscriberObject","id":"api/interfaces/SubscriberObject","isDocsHomePage":false,"title":"Interface: SubscriberObject","description":"Type parameters","source":"@site/docs/api/interfaces/SubscriberObject.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberObject","permalink":"/hfc-pubsub/api/interfaces/SubscriberObject","editUrl":null,"version":"current","sidebar_label":"SubscriberObject","sidebarPosition":0,"frontMatter":{"id":"SubscriberObject","title":"Interface: SubscriberObject","sidebar_label":"SubscriberObject","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: SubscriberMetadata","permalink":"/hfc-pubsub/api/interfaces/SubscriberMetadata"},"next":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/api/interfaces/SubscriberOptions"}},{"unversionedId":"api/interfaces/SubscriberOptions","id":"api/interfaces/SubscriberOptions","isDocsHomePage":false,"title":"Interface: SubscriberOptions","description":"Hierarchy","source":"@site/docs/api/interfaces/SubscriberOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberOptions","permalink":"/hfc-pubsub/api/interfaces/SubscriberOptions","editUrl":null,"version":"current","sidebar_label":"SubscriberOptions","sidebarPosition":0,"frontMatter":{"id":"SubscriberOptions","title":"Interface: SubscriberOptions","sidebar_label":"SubscriberOptions","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: SubscriberObject","permalink":"/hfc-pubsub/api/interfaces/SubscriberObject"},"next":{"title":"Interface: TopicOptions","permalink":"/hfc-pubsub/api/interfaces/TopicOptions"}},{"unversionedId":"api/interfaces/TopicOptions","id":"api/interfaces/TopicOptions","isDocsHomePage":false,"title":"Interface: TopicOptions","description":"Properties","source":"@site/docs/api/interfaces/TopicOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/TopicOptions","permalink":"/hfc-pubsub/api/interfaces/TopicOptions","editUrl":null,"version":"current","sidebar_label":"TopicOptions","sidebarPosition":0,"frontMatter":{"id":"TopicOptions","title":"Interface: TopicOptions","sidebar_label":"TopicOptions","sidebar_position":0,"custom_edit_url":null},"sidebar":"defaultSidebar","previous":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/api/interfaces/SubscriberOptions"},"next":{"title":"Changelog","permalink":"/hfc-pubsub/changelog"}},{"unversionedId":"changelog","id":"changelog","isDocsHomePage":false,"title":"Changelog","description":"2.2.2","source":"@site/docs/changelog.md","sourceDirName":".","slug":"/changelog","permalink":"/hfc-pubsub/changelog","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/changelog.md","version":"current","frontMatter":{},"sidebar":"defaultSidebar","previous":{"title":"Interface: TopicOptions","permalink":"/hfc-pubsub/api/interfaces/TopicOptions"}},{"unversionedId":"getting-started/installation","id":"getting-started/installation","isDocsHomePage":false,"title":"Installation","description":"Requirements","source":"@site/docs/getting-started/Installation.md","sourceDirName":"getting-started","slug":"/getting-started/installation","permalink":"/hfc-pubsub/getting-started/installation","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/getting-started/Installation.md","version":"current","sidebarPosition":1,"frontMatter":{"id":"installation","title":"Installation","slug":"/getting-started/installation","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Introduction","permalink":"/hfc-pubsub/"},"next":{"title":"Subscriptions","permalink":"/hfc-pubsub/subscribing/subscriptions"}},{"unversionedId":"guides/cli","id":"guides/cli","isDocsHomePage":false,"title":"CLI","description":"Prerequisites npm i -g npx","source":"@site/docs/guides/CLI.md","sourceDirName":"guides","slug":"/guides/cli","permalink":"/hfc-pubsub/guides/cli","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/CLI.md","version":"current","sidebarPosition":1,"frontMatter":{"id":"cli","title":"CLI","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Health Checks","permalink":"/hfc-pubsub/server/health-check"},"next":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/guides/drivers"}},{"unversionedId":"guides/drivers","id":"guides/drivers","isDocsHomePage":false,"title":"PubSub Drivers","description":"Google PubSub Driver","source":"@site/docs/guides/Drivers.md","sourceDirName":"guides","slug":"/guides/drivers","permalink":"/hfc-pubsub/guides/drivers","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/Drivers.md","version":"current","sidebarPosition":2,"frontMatter":{"id":"drivers","title":"PubSub Drivers","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"CLI","permalink":"/hfc-pubsub/guides/cli"},"next":{"title":"Migrating to v2","permalink":"/hfc-pubsub/guides/migrating-to-v2"}},{"unversionedId":"guides/migrating-to-v2","id":"guides/migrating-to-v2","isDocsHomePage":false,"title":"Migrating to v2","description":"We simplified and improved the experience of using PubSub Framework (especially for Typescript users) in v2, that meant changing the way we do a few things.","source":"@site/docs/guides/Migrating to v2.mdx","sourceDirName":"guides","slug":"/guides/migrating-to-v2","permalink":"/hfc-pubsub/guides/migrating-to-v2","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/Migrating to v2.mdx","version":"current","sidebarPosition":3,"frontMatter":{"id":"migrating-to-v2","title":"Migrating to v2","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/guides/drivers"},"next":{"title":"Testing","permalink":"/hfc-pubsub/guides/testing"}},{"unversionedId":"guides/testing","id":"guides/testing","isDocsHomePage":false,"title":"Testing","description":"Unit Tests","source":"@site/docs/guides/Testing.md","sourceDirName":"guides","slug":"/guides/testing","permalink":"/hfc-pubsub/guides/testing","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/guides/Testing.md","version":"current","sidebarPosition":4,"frontMatter":{"id":"testing","title":"Testing","sidebar_position":4},"sidebar":"defaultSidebar","previous":{"title":"Migrating to v2","permalink":"/hfc-pubsub/guides/migrating-to-v2"},"next":{"title":"Other Options","permalink":"/hfc-pubsub/options"}},{"unversionedId":"introduction","id":"introduction","isDocsHomePage":false,"title":"Introduction","description":"@honestfoodcompany/pubsub","source":"@site/docs/Introduction.md","sourceDirName":".","slug":"/","permalink":"/hfc-pubsub/","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/Introduction.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"introduction","title":"Introduction","sidebar_position":0,"slug":"/"},"sidebar":"defaultSidebar","next":{"title":"Installation","permalink":"/hfc-pubsub/getting-started/installation"}},{"unversionedId":"options","id":"options","isDocsHomePage":false,"title":"Other Options","description":"","source":"@site/docs/Options.md","sourceDirName":".","slug":"/options","permalink":"/hfc-pubsub/options","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/Options.md","version":"current","sidebarPosition":6,"frontMatter":{"id":"options","title":"Other Options","sidebar_position":6},"sidebar":"defaultSidebar","previous":{"title":"Testing","permalink":"/hfc-pubsub/guides/testing"},"next":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/api/"}},{"unversionedId":"publishing/attributes","id":"publishing/attributes","isDocsHomePage":false,"title":"Publishing with Attributes","description":"See:","source":"@site/docs/publishing/Attributes.md","sourceDirName":"publishing","slug":"/publishing/attributes","permalink":"/hfc-pubsub/publishing/attributes","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Attributes.md","version":"current","sidebar_label":"Attributes","sidebarPosition":2,"frontMatter":{"id":"attributes","title":"Publishing with Attributes","sidebar_label":"Attributes","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/publishing/retry-settings"},"next":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/publishing/publish-diff-project"}},{"unversionedId":"publishing/publish-diff-project","id":"publishing/publish-diff-project","isDocsHomePage":false,"title":"Publishing on a Different GCP project","description":"`ts title=\\"/pubsub/topics/example-topic-with-custom-credentials.ts\\"","source":"@site/docs/publishing/Publish Diff Project.md","sourceDirName":"publishing","slug":"/publishing/publish-diff-project","permalink":"/hfc-pubsub/publishing/publish-diff-project","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Publish Diff Project.md","version":"current","sidebar_label":"Different GCP project","sidebarPosition":3,"frontMatter":{"id":"publish-diff-project","title":"Publishing on a Different GCP project","sidebar_label":"Different GCP project","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/publishing/attributes"},"next":{"title":"Subscription Service","permalink":"/hfc-pubsub/server/service"}},{"unversionedId":"publishing/retry-settings","id":"publishing/retry-settings","isDocsHomePage":false,"title":"Publishing a message with retry settings","description":"NOTE: This may not work right now, it is a known bug.","source":"@site/docs/publishing/Retry Settings.md","sourceDirName":"publishing","slug":"/publishing/retry-settings","permalink":"/hfc-pubsub/publishing/retry-settings","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Retry Settings.md","version":"current","sidebar_label":"Retry Settings","sidebarPosition":1,"frontMatter":{"id":"retry-settings","title":"Publishing a message with retry settings","sidebar_label":"Retry Settings","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Topics","permalink":"/hfc-pubsub/publishing/topics"},"next":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/publishing/attributes"}},{"unversionedId":"publishing/topics","id":"publishing/topics","isDocsHomePage":false,"title":"Topics","description":"Create a topic in PUBSUBROOTDIR/topics which extends Topic and a payload which extends Payload from package.","source":"@site/docs/publishing/Topics.md","sourceDirName":"publishing","slug":"/publishing/topics","permalink":"/hfc-pubsub/publishing/topics","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/publishing/Topics.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"topics","title":"Topics","sidebar_position":0},"sidebar":"defaultSidebar","previous":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/subscribing/message-ordering"},"next":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/publishing/retry-settings"}},{"unversionedId":"server/connect-database","id":"server/connect-database","isDocsHomePage":false,"title":"Connecting to a Database","description":"It is recommended to initialize a database connection in the subscription.service file in your PUBSUBROOTDIR. Insert your database connection logic in the init method.","source":"@site/docs/server/Connect Database.md","sourceDirName":"server","slug":"/server/connect-database","permalink":"/hfc-pubsub/server/connect-database","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Connect Database.md","version":"current","sidebar_label":"Connect Database","sidebarPosition":2,"frontMatter":{"id":"connect-database","title":"Connecting to a Database","sidebar_label":"Connect Database","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/server/custom-logger"},"next":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/server/graceful-shutdown"}},{"unversionedId":"server/custom-logger","id":"server/custom-logger","isDocsHomePage":false,"title":"Passing a Custom Logger","description":"In the main SubscriptionService before defining subscription class you can update the logger that is being used by the package for logging. It\'s an optional definition and by default it uses console.* for logging .info, .warn and .error these 3 function keys are a must have for the logger you pass.","source":"@site/docs/server/Custom Logger.md","sourceDirName":"server","slug":"/server/custom-logger","permalink":"/hfc-pubsub/server/custom-logger","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Custom Logger.md","version":"current","sidebar_label":"Custom Logger","sidebarPosition":1,"frontMatter":{"id":"custom-logger","title":"Passing a Custom Logger","sidebar_label":"Custom Logger","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Subscription Service","permalink":"/hfc-pubsub/server/service"},"next":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/server/connect-database"}},{"unversionedId":"server/graceful-shutdown","id":"server/graceful-shutdown","isDocsHomePage":false,"title":"Graceful Shutdown","description":"When gracefully shutting down a process, it is a good idea to first close all open subscriptions and DB connections. For this reason we have a static closeAll method in the SubscriptionService that can close all connections before shutting down. An example using it with process signal handlers:","source":"@site/docs/server/Graceful Shutdown.md","sourceDirName":"server","slug":"/server/graceful-shutdown","permalink":"/hfc-pubsub/server/graceful-shutdown","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Graceful Shutdown.md","version":"current","sidebarPosition":3,"frontMatter":{"id":"graceful-shutdown","title":"Graceful Shutdown","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/server/connect-database"},"next":{"title":"Health Checks","permalink":"/hfc-pubsub/server/health-check"}},{"unversionedId":"server/health-check","id":"server/health-check","isDocsHomePage":false,"title":"Health Checks","description":"For health checks and readiness probes you can enable the inbuilt health check http server by setting the following environment variables (or corresponding CLI option) :","source":"@site/docs/server/Health Check.md","sourceDirName":"server","slug":"/server/health-check","permalink":"/hfc-pubsub/server/health-check","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Health Check.md","version":"current","sidebarPosition":4,"frontMatter":{"id":"health-check","title":"Health Checks","sidebar_position":4},"sidebar":"defaultSidebar","previous":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/server/graceful-shutdown"},"next":{"title":"CLI","permalink":"/hfc-pubsub/guides/cli"}},{"unversionedId":"server/service","id":"server/service","isDocsHomePage":false,"title":"Subscription Service","description":"Extend and customize the behavior of the subscription server in the subscription.service file. Initialize a database connection, register subscribers, and define default subscriber options in the subscription service file.","source":"@site/docs/server/Service.md","sourceDirName":"server","slug":"/server/service","permalink":"/hfc-pubsub/server/service","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/server/Service.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"service","title":"Subscription Service","sidebar_position":0},"sidebar":"defaultSidebar","previous":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/publishing/publish-diff-project"},"next":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/server/custom-logger"}},{"unversionedId":"subscribing/dead-letter-policy","id":"subscribing/dead-letter-policy","isDocsHomePage":false,"title":"Subscriptions with a Dead-letter Policy","description":"It is possible to define a dead-letter policy for a subscription. If the dead letter topic does not exist, it will be created automatically by the framework.","source":"@site/docs/subscribing/Dead Letter Policy.md","sourceDirName":"subscribing","slug":"/subscribing/dead-letter-policy","permalink":"/hfc-pubsub/subscribing/dead-letter-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Dead Letter Policy.md","version":"current","sidebar_label":"Dead Letter Policy","sidebarPosition":1,"frontMatter":{"id":"dead-letter-policy","title":"Subscriptions with a Dead-letter Policy","sidebar_label":"Dead Letter Policy","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Subscriptions","permalink":"/hfc-pubsub/subscribing/subscriptions"},"next":{"title":"Messages compression","permalink":"/hfc-pubsub/subscribing/Messages_compression"}},{"unversionedId":"subscribing/error-handling","id":"subscribing/error-handling","isDocsHomePage":false,"title":"Internal Error Handling","description":"To handle any internal error that might occur on pubsub side, the method handleError can be declared either in Subscriber Object or in SubscriptionService.","source":"@site/docs/subscribing/Internal Error Handling.md","sourceDirName":"subscribing","slug":"/subscribing/error-handling","permalink":"/hfc-pubsub/subscribing/error-handling","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Internal Error Handling.md","version":"current","sidebar_label":"Error Handling","sidebarPosition":2,"frontMatter":{"id":"error-handling","title":"Internal Error Handling","sidebar_label":"Error Handling","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Messages compression","permalink":"/hfc-pubsub/subscribing/Messages_compression"},"next":{"title":"Adding Labels","permalink":"/hfc-pubsub/subscribing/labels"}},{"unversionedId":"subscribing/labels","id":"subscribing/labels","isDocsHomePage":false,"title":"Adding Labels","description":"Global Labels","source":"@site/docs/subscribing/Labels.md","sourceDirName":"subscribing","slug":"/subscribing/labels","permalink":"/hfc-pubsub/subscribing/labels","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Labels.md","version":"current","sidebar_label":"Labels","sidebarPosition":2,"frontMatter":{"id":"labels","title":"Adding Labels","sidebar_label":"Labels","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/subscribing/error-handling"},"next":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/subscribing/retry-policy"}},{"unversionedId":"subscribing/message-ordering","id":"subscribing/message-ordering","isDocsHomePage":false,"title":"Subscription with Message Ordering","description":"Messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.","source":"@site/docs/subscribing/Message Ordering.md","sourceDirName":"subscribing","slug":"/subscribing/message-ordering","permalink":"/hfc-pubsub/subscribing/message-ordering","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Message Ordering.md","version":"current","sidebar_label":"Message Ordering","sidebarPosition":3,"frontMatter":{"id":"message-ordering","title":"Subscription with Message Ordering","sidebar_label":"Message Ordering","sidebar_position":3},"sidebar":"defaultSidebar","previous":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/subscribing/retry-policy"},"next":{"title":"Topics","permalink":"/hfc-pubsub/publishing/topics"}},{"unversionedId":"subscribing/Messages_compression","id":"subscribing/Messages_compression","isDocsHomePage":false,"title":"Messages compression","description":"Framework supports gzip compression/decompression for messages.","source":"@site/docs/subscribing/Messages Compression.md","sourceDirName":"subscribing","slug":"/subscribing/Messages_compression","permalink":"/hfc-pubsub/subscribing/Messages_compression","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Messages Compression.md","version":"current","sidebarPosition":1,"frontMatter":{"id":"Messages_compression","title":"Messages compression","sidebar_position":1},"sidebar":"defaultSidebar","previous":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/subscribing/dead-letter-policy"},"next":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/subscribing/error-handling"}},{"unversionedId":"subscribing/retry-policy","id":"subscribing/retry-policy","isDocsHomePage":false,"title":"Subscriptions with Retry Policy","description":"It is possible to define a retry configuration for a subscription:","source":"@site/docs/subscribing/Retry Policy.md","sourceDirName":"subscribing","slug":"/subscribing/retry-policy","permalink":"/hfc-pubsub/subscribing/retry-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Retry Policy.md","version":"current","sidebar_label":"Retry Policy","sidebarPosition":2,"frontMatter":{"id":"retry-policy","title":"Subscriptions with Retry Policy","sidebar_label":"Retry Policy","sidebar_position":2},"sidebar":"defaultSidebar","previous":{"title":"Adding Labels","permalink":"/hfc-pubsub/subscribing/labels"},"next":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/subscribing/message-ordering"}},{"unversionedId":"subscribing/subscriptions","id":"subscribing/subscriptions","isDocsHomePage":false,"title":"Subscriptions","description":"Create a Subscriber to define a message handler for messages that are published on the corresponding topic.","source":"@site/docs/subscribing/Subscriptions.md","sourceDirName":"subscribing","slug":"/subscribing/subscriptions","permalink":"/hfc-pubsub/subscribing/subscriptions","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/docs/subscribing/Subscriptions.md","version":"current","sidebarPosition":0,"frontMatter":{"id":"subscriptions","title":"Subscriptions","sidebar_position":0},"sidebar":"defaultSidebar","previous":{"title":"Installation","permalink":"/hfc-pubsub/getting-started/installation"},"next":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/subscribing/dead-letter-policy"}}]},{"versionName":"v1","versionLabel":"v1","versionPath":"/hfc-pubsub/v1","versionEditUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1","versionEditUrlLocalized":"https://github.com/deliveryhero/hfc-pubsub/edit/main/i18n/en/docusaurus-plugin-content-docs/version-v1","isLast":false,"sidebarFilePath":"/home/runner/work/hfc-pubsub/hfc-pubsub/versioned_sidebars/version-v1-sidebars.json","contentPath":"/home/runner/work/hfc-pubsub/hfc-pubsub/versioned_docs/version-v1","contentPathLocalized":"/home/runner/work/hfc-pubsub/hfc-pubsub/i18n/en/docusaurus-plugin-content-docs/version-v1","mainDocId":"introduction","sidebars":{"version-v1/defaultSidebar":[{"type":"doc","id":"version-v1/introduction"},{"type":"category","label":"Getting Started","items":[{"type":"doc","id":"version-v1/getting-started/installation"}],"collapsed":false},{"type":"category","label":"Subscribing","items":[{"type":"doc","id":"version-v1/subscribing/subscriptions"},{"type":"doc","id":"version-v1/subscribing/dead-letter-policy","label":"Dead Letter Policy"},{"type":"doc","id":"version-v1/subscribing/error-handling","label":"Error Handling"},{"type":"doc","id":"version-v1/subscribing/retry-policy","label":"Retry Policy"},{"type":"doc","id":"version-v1/subscribing/message-ordering","label":"Message Ordering"}],"collapsed":true},{"type":"category","label":"Publishing","items":[{"type":"doc","id":"version-v1/publishing/topics"},{"type":"doc","id":"version-v1/publishing/retry-settings","label":"Retry Settings"},{"type":"doc","id":"version-v1/publishing/attributes","label":"Attributes"},{"type":"doc","id":"version-v1/publishing/publish-diff-project","label":"Different GCP project"}],"collapsed":true},{"type":"category","label":"Server","items":[{"type":"doc","id":"version-v1/server/service"},{"type":"doc","id":"version-v1/server/custom-logger","label":"Custom Logger"},{"type":"doc","id":"version-v1/server/connect-database","label":"Connect Database"},{"type":"doc","id":"version-v1/server/graceful-shutdown"},{"type":"doc","id":"version-v1/server/health-check"}],"collapsed":true},{"type":"doc","id":"version-v1/cli"},{"type":"doc","id":"version-v1/drivers"},{"type":"doc","id":"version-v1/options"},{"type":"category","label":"Guides","items":[{"type":"doc","id":"version-v1/guides/testing"}],"collapsed":true},{"type":"category","label":"API","items":[{"type":"doc","id":"version-v1/api/index","label":"Exports"},{"type":"category","label":"Namespaces","items":[{"type":"doc","id":"version-v1/api/namespaces/Interfaces","label":"Interfaces"}],"collapsed":true},{"type":"category","label":"Classes","items":[{"type":"doc","id":"version-v1/api/classes/Message","label":"Message"},{"type":"doc","id":"version-v1/api/classes/PubSubService","label":"PubSubService"},{"type":"doc","id":"version-v1/api/classes/Subscriber","label":"Subscriber"},{"type":"doc","id":"version-v1/api/classes/SubscriptionService","label":"SubscriptionService"},{"type":"doc","id":"version-v1/api/classes/Topic","label":"Topic"}],"collapsed":true},{"type":"category","label":"Interfaces","items":[{"type":"doc","id":"version-v1/api/interfaces/Payload","label":"Payload"},{"type":"doc","id":"version-v1/api/interfaces/SubscriberOptions","label":"SubscriberOptions"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.BackoffSettings","label":"BackoffSettings"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.GooglePubSubProject","label":"GooglePubSubProject"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.PublishOptions","label":"PublishOptions"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.RetryConfig","label":"RetryConfig"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.TopicPublishOptions","label":"TopicPublishOptions"},{"type":"doc","id":"version-v1/api/interfaces/Interfaces.pubSubClient","label":"pubSubClient"}],"collapsed":true}],"collapsed":true}]},"permalinkToSidebar":{"/hfc-pubsub/v1/api/classes/Message":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/PubSubService":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/Subscriber":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/SubscriptionService":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/classes/Topic":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.pubSubClient":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/Payload":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/interfaces/SubscriberOptions":"version-v1/defaultSidebar","/hfc-pubsub/v1/api/namespaces/Interfaces":"version-v1/defaultSidebar","/hfc-pubsub/v1/cli":"version-v1/defaultSidebar","/hfc-pubsub/v1/drivers":"version-v1/defaultSidebar","/hfc-pubsub/v1/getting-started/installation":"version-v1/defaultSidebar","/hfc-pubsub/v1/guides/testing":"version-v1/defaultSidebar","/hfc-pubsub/v1/":"version-v1/defaultSidebar","/hfc-pubsub/v1/options":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/attributes":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/publish-diff-project":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/retry-settings":"version-v1/defaultSidebar","/hfc-pubsub/v1/publishing/topics":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/connect-database":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/custom-logger":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/graceful-shutdown":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/health-check":"version-v1/defaultSidebar","/hfc-pubsub/v1/server/service":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/dead-letter-policy":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/error-handling":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/message-ordering":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/retry-policy":"version-v1/defaultSidebar","/hfc-pubsub/v1/subscribing/subscriptions":"version-v1/defaultSidebar"},"docs":[{"unversionedId":"api/classes/Message","id":"version-v1/api/classes/Message","isDocsHomePage":false,"title":"Class: Message","description":"Constructors","source":"@site/versioned_docs/version-v1/api/classes/Message.md","sourceDirName":"api/classes","slug":"/api/classes/Message","permalink":"/hfc-pubsub/v1/api/classes/Message","editUrl":null,"version":"v1","sidebar_label":"Message","sidebarPosition":0,"frontMatter":{"id":"Message","title":"Class: Message","sidebar_label":"Message","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Namespace: Interfaces","permalink":"/hfc-pubsub/v1/api/namespaces/Interfaces"},"next":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/v1/api/classes/PubSubService"}},{"unversionedId":"api/classes/PubSubService","id":"version-v1/api/classes/PubSubService","isDocsHomePage":false,"title":"Class: PubSubService","description":"Constructors","source":"@site/versioned_docs/version-v1/api/classes/PubSubService.md","sourceDirName":"api/classes","slug":"/api/classes/PubSubService","permalink":"/hfc-pubsub/v1/api/classes/PubSubService","editUrl":null,"version":"v1","sidebar_label":"PubSubService","sidebarPosition":0,"frontMatter":{"id":"PubSubService","title":"Class: PubSubService","sidebar_label":"PubSubService","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: Message","permalink":"/hfc-pubsub/v1/api/classes/Message"},"next":{"title":"Class: Subscriber","permalink":"/hfc-pubsub/v1/api/classes/Subscriber"}},{"unversionedId":"api/classes/Subscriber","id":"version-v1/api/classes/Subscriber","isDocsHomePage":false,"title":"Class: Subscriber","description":"deprecated","source":"@site/versioned_docs/version-v1/api/classes/Subscriber.md","sourceDirName":"api/classes","slug":"/api/classes/Subscriber","permalink":"/hfc-pubsub/v1/api/classes/Subscriber","editUrl":null,"version":"v1","sidebar_label":"Subscriber","sidebarPosition":0,"frontMatter":{"id":"Subscriber","title":"Class: Subscriber","sidebar_label":"Subscriber","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: PubSubService","permalink":"/hfc-pubsub/v1/api/classes/PubSubService"},"next":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/v1/api/classes/SubscriptionService"}},{"unversionedId":"api/classes/SubscriptionService","id":"version-v1/api/classes/SubscriptionService","isDocsHomePage":false,"title":"Class: SubscriptionService","description":"Constructors","source":"@site/versioned_docs/version-v1/api/classes/SubscriptionService.md","sourceDirName":"api/classes","slug":"/api/classes/SubscriptionService","permalink":"/hfc-pubsub/v1/api/classes/SubscriptionService","editUrl":null,"version":"v1","sidebar_label":"SubscriptionService","sidebarPosition":0,"frontMatter":{"id":"SubscriptionService","title":"Class: SubscriptionService","sidebar_label":"SubscriptionService","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: Subscriber","permalink":"/hfc-pubsub/v1/api/classes/Subscriber"},"next":{"title":"Class: Topic","permalink":"/hfc-pubsub/v1/api/classes/Topic"}},{"unversionedId":"api/classes/Topic","id":"version-v1/api/classes/Topic","isDocsHomePage":false,"title":"Class: Topic","description":"Implements","source":"@site/versioned_docs/version-v1/api/classes/Topic.md","sourceDirName":"api/classes","slug":"/api/classes/Topic","permalink":"/hfc-pubsub/v1/api/classes/Topic","editUrl":null,"version":"v1","sidebar_label":"Topic","sidebarPosition":0,"frontMatter":{"id":"Topic","title":"Class: Topic","sidebar_label":"Topic","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: SubscriptionService","permalink":"/hfc-pubsub/v1/api/classes/SubscriptionService"},"next":{"title":"Interface: Payload","permalink":"/hfc-pubsub/v1/api/interfaces/Payload"}},{"unversionedId":"api/index","id":"version-v1/api/index","isDocsHomePage":false,"title":"@honestfoodcompany/pubsub","description":"Namespaces","source":"@site/versioned_docs/version-v1/api/index.md","sourceDirName":"api","slug":"/api/","permalink":"/hfc-pubsub/v1/api/","editUrl":null,"version":"v1","sidebar_label":"Exports","sidebarPosition":0.5,"frontMatter":{"id":"index","title":"@honestfoodcompany/pubsub","slug":"/api/","sidebar_label":"Exports","sidebar_position":0.5,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Testing","permalink":"/hfc-pubsub/v1/guides/testing"},"next":{"title":"Namespace: Interfaces","permalink":"/hfc-pubsub/v1/api/namespaces/Interfaces"}},{"unversionedId":"api/interfaces/Interfaces.BackoffSettings","id":"version-v1/api/interfaces/Interfaces.BackoffSettings","isDocsHomePage":false,"title":"Interface: BackoffSettings","description":"Interfaces.BackoffSettings","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.BackoffSettings.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.BackoffSettings","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings","editUrl":null,"version":"v1","sidebar_label":"BackoffSettings","frontMatter":{"id":"Interfaces.BackoffSettings","title":"Interface: BackoffSettings","sidebar_label":"BackoffSettings","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/v1/api/interfaces/SubscriberOptions"},"next":{"title":"Interface: GooglePubSubProject","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject"}},{"unversionedId":"api/interfaces/Interfaces.GooglePubSubProject","id":"version-v1/api/interfaces/Interfaces.GooglePubSubProject","isDocsHomePage":false,"title":"Interface: GooglePubSubProject","description":"Interfaces.GooglePubSubProject","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.GooglePubSubProject.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.GooglePubSubProject","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject","editUrl":null,"version":"v1","sidebar_label":"GooglePubSubProject","frontMatter":{"id":"Interfaces.GooglePubSubProject","title":"Interface: GooglePubSubProject","sidebar_label":"GooglePubSubProject","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: BackoffSettings","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings"},"next":{"title":"Interface: PublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions"}},{"unversionedId":"api/interfaces/Interfaces.PublishOptions","id":"version-v1/api/interfaces/Interfaces.PublishOptions","isDocsHomePage":false,"title":"Interface: PublishOptions","description":"Interfaces.PublishOptions","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.PublishOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.PublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions","editUrl":null,"version":"v1","sidebar_label":"PublishOptions","frontMatter":{"id":"Interfaces.PublishOptions","title":"Interface: PublishOptions","sidebar_label":"PublishOptions","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: GooglePubSubProject","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.GooglePubSubProject"},"next":{"title":"Interface: RetryConfig","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig"}},{"unversionedId":"api/interfaces/Interfaces.pubSubClient","id":"version-v1/api/interfaces/Interfaces.pubSubClient","isDocsHomePage":false,"title":"Interface: pubSubClient","description":"Interfaces.pubSubClient","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.pubSubClient.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.pubSubClient","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.pubSubClient","editUrl":null,"version":"v1","sidebar_label":"pubSubClient","frontMatter":{"id":"Interfaces.pubSubClient","title":"Interface: pubSubClient","sidebar_label":"pubSubClient","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: TopicPublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions"}},{"unversionedId":"api/interfaces/Interfaces.RetryConfig","id":"version-v1/api/interfaces/Interfaces.RetryConfig","isDocsHomePage":false,"title":"Interface: RetryConfig","description":"Interfaces.RetryConfig","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.RetryConfig.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.RetryConfig","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig","editUrl":null,"version":"v1","sidebar_label":"RetryConfig","frontMatter":{"id":"Interfaces.RetryConfig","title":"Interface: RetryConfig","sidebar_label":"RetryConfig","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: PublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.PublishOptions"},"next":{"title":"Interface: TopicPublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions"}},{"unversionedId":"api/interfaces/Interfaces.TopicPublishOptions","id":"version-v1/api/interfaces/Interfaces.TopicPublishOptions","isDocsHomePage":false,"title":"Interface: TopicPublishOptions","description":"Interfaces.TopicPublishOptions","source":"@site/versioned_docs/version-v1/api/interfaces/Interfaces.TopicPublishOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Interfaces.TopicPublishOptions","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.TopicPublishOptions","editUrl":null,"version":"v1","sidebar_label":"TopicPublishOptions","frontMatter":{"id":"Interfaces.TopicPublishOptions","title":"Interface: TopicPublishOptions","sidebar_label":"TopicPublishOptions","custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: RetryConfig","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.RetryConfig"},"next":{"title":"Interface: pubSubClient","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.pubSubClient"}},{"unversionedId":"api/interfaces/Payload","id":"version-v1/api/interfaces/Payload","isDocsHomePage":false,"title":"Interface: Payload","description":"extend this interface to define your own payload","source":"@site/versioned_docs/version-v1/api/interfaces/Payload.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/Payload","permalink":"/hfc-pubsub/v1/api/interfaces/Payload","editUrl":null,"version":"v1","sidebar_label":"Payload","sidebarPosition":0,"frontMatter":{"id":"Payload","title":"Interface: Payload","sidebar_label":"Payload","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Class: Topic","permalink":"/hfc-pubsub/v1/api/classes/Topic"},"next":{"title":"Interface: SubscriberOptions","permalink":"/hfc-pubsub/v1/api/interfaces/SubscriberOptions"}},{"unversionedId":"api/interfaces/SubscriberOptions","id":"version-v1/api/interfaces/SubscriberOptions","isDocsHomePage":false,"title":"Interface: SubscriberOptions","description":"Hierarchy","source":"@site/versioned_docs/version-v1/api/interfaces/SubscriberOptions.md","sourceDirName":"api/interfaces","slug":"/api/interfaces/SubscriberOptions","permalink":"/hfc-pubsub/v1/api/interfaces/SubscriberOptions","editUrl":null,"version":"v1","sidebar_label":"SubscriberOptions","sidebarPosition":0,"frontMatter":{"id":"SubscriberOptions","title":"Interface: SubscriberOptions","sidebar_label":"SubscriberOptions","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Interface: Payload","permalink":"/hfc-pubsub/v1/api/interfaces/Payload"},"next":{"title":"Interface: BackoffSettings","permalink":"/hfc-pubsub/v1/api/interfaces/Interfaces.BackoffSettings"}},{"unversionedId":"api/namespaces/Interfaces","id":"version-v1/api/namespaces/Interfaces","isDocsHomePage":false,"title":"Namespace: Interfaces","description":"Interfaces","source":"@site/versioned_docs/version-v1/api/namespaces/Interfaces.md","sourceDirName":"api/namespaces","slug":"/api/namespaces/Interfaces","permalink":"/hfc-pubsub/v1/api/namespaces/Interfaces","editUrl":null,"version":"v1","sidebar_label":"Interfaces","sidebarPosition":0,"frontMatter":{"id":"Interfaces","title":"Namespace: Interfaces","sidebar_label":"Interfaces","sidebar_position":0,"custom_edit_url":null},"sidebar":"version-v1/defaultSidebar","previous":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/v1/api/"},"next":{"title":"Class: Message","permalink":"/hfc-pubsub/v1/api/classes/Message"}},{"unversionedId":"cli","id":"version-v1/cli","isDocsHomePage":false,"title":"CLI","description":"Prerequisites npm i -g npx","source":"@site/versioned_docs/version-v1/CLI.md","sourceDirName":".","slug":"/cli","permalink":"/hfc-pubsub/v1/cli","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/CLI.md","version":"v1","sidebarPosition":5,"frontMatter":{"id":"cli","title":"CLI","sidebar_position":5},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Health Checks","permalink":"/hfc-pubsub/v1/server/health-check"},"next":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/v1/drivers"}},{"unversionedId":"drivers","id":"version-v1/drivers","isDocsHomePage":false,"title":"PubSub Drivers","description":"Google PubSub Driver","source":"@site/versioned_docs/version-v1/Drivers.md","sourceDirName":".","slug":"/drivers","permalink":"/hfc-pubsub/v1/drivers","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/Drivers.md","version":"v1","sidebarPosition":5,"frontMatter":{"id":"drivers","title":"PubSub Drivers","sidebar_position":5},"sidebar":"version-v1/defaultSidebar","previous":{"title":"CLI","permalink":"/hfc-pubsub/v1/cli"},"next":{"title":"Other Options","permalink":"/hfc-pubsub/v1/options"}},{"unversionedId":"getting-started/installation","id":"version-v1/getting-started/installation","isDocsHomePage":false,"title":"Installation","description":"Requirements","source":"@site/versioned_docs/version-v1/getting-started/Installation.md","sourceDirName":"getting-started","slug":"/getting-started/installation","permalink":"/hfc-pubsub/v1/getting-started/installation","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/getting-started/Installation.md","version":"v1","sidebarPosition":1,"frontMatter":{"id":"installation","title":"Installation","slug":"/getting-started/installation","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Introduction","permalink":"/hfc-pubsub/v1/"},"next":{"title":"Subscriptions","permalink":"/hfc-pubsub/v1/subscribing/subscriptions"}},{"unversionedId":"guides/testing","id":"version-v1/guides/testing","isDocsHomePage":false,"title":"Testing","description":"Unit Tests","source":"@site/versioned_docs/version-v1/guides/Testing.md","sourceDirName":"guides","slug":"/guides/testing","permalink":"/hfc-pubsub/v1/guides/testing","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/guides/Testing.md","version":"v1","sidebarPosition":2,"frontMatter":{"id":"testing","title":"Testing","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Other Options","permalink":"/hfc-pubsub/v1/options"},"next":{"title":"@honestfoodcompany/pubsub","permalink":"/hfc-pubsub/v1/api/"}},{"unversionedId":"introduction","id":"version-v1/introduction","isDocsHomePage":false,"title":"Introduction","description":"@honestfoodcompany/pubsub","source":"@site/versioned_docs/version-v1/Introduction.md","sourceDirName":".","slug":"/","permalink":"/hfc-pubsub/v1/","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/Introduction.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"introduction","title":"Introduction","sidebar_position":0,"slug":"/"},"sidebar":"version-v1/defaultSidebar","next":{"title":"Installation","permalink":"/hfc-pubsub/v1/getting-started/installation"}},{"unversionedId":"options","id":"version-v1/options","isDocsHomePage":false,"title":"Other Options","description":"Enabling gRPC C++ bindings","source":"@site/versioned_docs/version-v1/Options.md","sourceDirName":".","slug":"/options","permalink":"/hfc-pubsub/v1/options","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/Options.md","version":"v1","sidebarPosition":6,"frontMatter":{"id":"options","title":"Other Options","sidebar_position":6},"sidebar":"version-v1/defaultSidebar","previous":{"title":"PubSub Drivers","permalink":"/hfc-pubsub/v1/drivers"},"next":{"title":"Testing","permalink":"/hfc-pubsub/v1/guides/testing"}},{"unversionedId":"publishing/attributes","id":"version-v1/publishing/attributes","isDocsHomePage":false,"title":"Publishing with Attributes","description":"See:","source":"@site/versioned_docs/version-v1/publishing/Attributes.md","sourceDirName":"publishing","slug":"/publishing/attributes","permalink":"/hfc-pubsub/v1/publishing/attributes","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Attributes.md","version":"v1","sidebar_label":"Attributes","sidebarPosition":2,"frontMatter":{"id":"attributes","title":"Publishing with Attributes","sidebar_label":"Attributes","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/v1/publishing/retry-settings"},"next":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/v1/publishing/publish-diff-project"}},{"unversionedId":"publishing/publish-diff-project","id":"version-v1/publishing/publish-diff-project","isDocsHomePage":false,"title":"Publishing on a Different GCP project","description":"`ts title=\\"/pubsub/topics/example-topic-with-customCredentials.ts\\"","source":"@site/versioned_docs/version-v1/publishing/Publish Diff Project.md","sourceDirName":"publishing","slug":"/publishing/publish-diff-project","permalink":"/hfc-pubsub/v1/publishing/publish-diff-project","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Publish Diff Project.md","version":"v1","sidebar_label":"Different GCP project","sidebarPosition":3,"frontMatter":{"id":"publish-diff-project","title":"Publishing on a Different GCP project","sidebar_label":"Different GCP project","sidebar_position":3},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/v1/publishing/attributes"},"next":{"title":"Subscription Service","permalink":"/hfc-pubsub/v1/server/service"}},{"unversionedId":"publishing/retry-settings","id":"version-v1/publishing/retry-settings","isDocsHomePage":false,"title":"Publishing a message with retry settings","description":"NOTE: This may not work right now, it is a known bug.","source":"@site/versioned_docs/version-v1/publishing/Retry Settings.md","sourceDirName":"publishing","slug":"/publishing/retry-settings","permalink":"/hfc-pubsub/v1/publishing/retry-settings","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Retry Settings.md","version":"v1","sidebar_label":"Retry Settings","sidebarPosition":1,"frontMatter":{"id":"retry-settings","title":"Publishing a message with retry settings","sidebar_label":"Retry Settings","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Topics","permalink":"/hfc-pubsub/v1/publishing/topics"},"next":{"title":"Publishing with Attributes","permalink":"/hfc-pubsub/v1/publishing/attributes"}},{"unversionedId":"publishing/topics","id":"version-v1/publishing/topics","isDocsHomePage":false,"title":"Topics","description":"Create a topic in PUBSUBROOTDIR/topics which extends Topic and a payload which extends Payload from package.","source":"@site/versioned_docs/version-v1/publishing/Topics.md","sourceDirName":"publishing","slug":"/publishing/topics","permalink":"/hfc-pubsub/v1/publishing/topics","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/publishing/Topics.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"topics","title":"Topics","sidebar_position":0},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/v1/subscribing/message-ordering"},"next":{"title":"Publishing a message with retry settings","permalink":"/hfc-pubsub/v1/publishing/retry-settings"}},{"unversionedId":"server/connect-database","id":"version-v1/server/connect-database","isDocsHomePage":false,"title":"Connecting to a Database","description":"It is recommended to initialize a database connection in the subscription.service file in your PUBSUBROOTDIR. Insert your database connection logic in the init method.","source":"@site/versioned_docs/version-v1/server/Connect Database.md","sourceDirName":"server","slug":"/server/connect-database","permalink":"/hfc-pubsub/v1/server/connect-database","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Connect Database.md","version":"v1","sidebar_label":"Connect Database","sidebarPosition":2,"frontMatter":{"id":"connect-database","title":"Connecting to a Database","sidebar_label":"Connect Database","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/v1/server/custom-logger"},"next":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/v1/server/graceful-shutdown"}},{"unversionedId":"server/custom-logger","id":"version-v1/server/custom-logger","isDocsHomePage":false,"title":"Passing a Custom Logger","description":"In the main SubscriptionService before defining subscription class you can update the logger that is being used by the package for logging. It\'s an optional definition and by default it uses console.* for logging .info, .warn and .error these 3 function keys are a must have for the logger you pass.","source":"@site/versioned_docs/version-v1/server/Custom Logger.md","sourceDirName":"server","slug":"/server/custom-logger","permalink":"/hfc-pubsub/v1/server/custom-logger","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Custom Logger.md","version":"v1","sidebar_label":"Custom Logger","sidebarPosition":1,"frontMatter":{"id":"custom-logger","title":"Passing a Custom Logger","sidebar_label":"Custom Logger","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscription Service","permalink":"/hfc-pubsub/v1/server/service"},"next":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/v1/server/connect-database"}},{"unversionedId":"server/graceful-shutdown","id":"version-v1/server/graceful-shutdown","isDocsHomePage":false,"title":"Graceful Shutdown","description":"When gracefully shutting down a process, it is a good idea to first close all open subscriptions and DB connections. For this reason we have a static closeAll method in the SubscriptionService that can close all connections before shutting down. An example using it with process signal handlers:","source":"@site/versioned_docs/version-v1/server/Graceful Shutdown.md","sourceDirName":"server","slug":"/server/graceful-shutdown","permalink":"/hfc-pubsub/v1/server/graceful-shutdown","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Graceful Shutdown.md","version":"v1","sidebarPosition":3,"frontMatter":{"id":"graceful-shutdown","title":"Graceful Shutdown","sidebar_position":3},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Connecting to a Database","permalink":"/hfc-pubsub/v1/server/connect-database"},"next":{"title":"Health Checks","permalink":"/hfc-pubsub/v1/server/health-check"}},{"unversionedId":"server/health-check","id":"version-v1/server/health-check","isDocsHomePage":false,"title":"Health Checks","description":"For health checks and readiness probes you can enable the inbuilt health check http server by setting the following environemnt variables (or corresponding CLI option) :","source":"@site/versioned_docs/version-v1/server/Health Check.md","sourceDirName":"server","slug":"/server/health-check","permalink":"/hfc-pubsub/v1/server/health-check","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Health Check.md","version":"v1","sidebarPosition":4,"frontMatter":{"id":"health-check","title":"Health Checks","sidebar_position":4},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Graceful Shutdown","permalink":"/hfc-pubsub/v1/server/graceful-shutdown"},"next":{"title":"CLI","permalink":"/hfc-pubsub/v1/cli"}},{"unversionedId":"server/service","id":"version-v1/server/service","isDocsHomePage":false,"title":"Subscription Service","description":"Extend and customize the behavior of the subscription server in the subscription.service file. Initialize a database connection, register subscribers, and define default subscriber options in the subscription service file.","source":"@site/versioned_docs/version-v1/server/Service.md","sourceDirName":"server","slug":"/server/service","permalink":"/hfc-pubsub/v1/server/service","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/server/Service.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"service","title":"Subscription Service","sidebar_position":0},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Publishing on a Different GCP project","permalink":"/hfc-pubsub/v1/publishing/publish-diff-project"},"next":{"title":"Passing a Custom Logger","permalink":"/hfc-pubsub/v1/server/custom-logger"}},{"unversionedId":"subscribing/dead-letter-policy","id":"version-v1/subscribing/dead-letter-policy","isDocsHomePage":false,"title":"Subscriptions with a Dead-letter Policy","description":"It is possible to define a dead-letter policy for a subscription. If the dead letter topic does not exist, it will be created automatically by the framework.","source":"@site/versioned_docs/version-v1/subscribing/Dead Letter Policy.md","sourceDirName":"subscribing","slug":"/subscribing/dead-letter-policy","permalink":"/hfc-pubsub/v1/subscribing/dead-letter-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Dead Letter Policy.md","version":"v1","sidebar_label":"Dead Letter Policy","sidebarPosition":1,"frontMatter":{"id":"dead-letter-policy","title":"Subscriptions with a Dead-letter Policy","sidebar_label":"Dead Letter Policy","sidebar_position":1},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscriptions","permalink":"/hfc-pubsub/v1/subscribing/subscriptions"},"next":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/v1/subscribing/error-handling"}},{"unversionedId":"subscribing/error-handling","id":"version-v1/subscribing/error-handling","isDocsHomePage":false,"title":"Internal Error Handling","description":"To handle any internal error that might occur on pubsub side, a the method handleError can be declared either in Subscriber Object or in SubscriptionService level.","source":"@site/versioned_docs/version-v1/subscribing/Internal Error Handling.md","sourceDirName":"subscribing","slug":"/subscribing/error-handling","permalink":"/hfc-pubsub/v1/subscribing/error-handling","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Internal Error Handling.md","version":"v1","sidebar_label":"Error Handling","sidebarPosition":2,"frontMatter":{"id":"error-handling","title":"Internal Error Handling","sidebar_label":"Error Handling","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/v1/subscribing/dead-letter-policy"},"next":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/v1/subscribing/retry-policy"}},{"unversionedId":"subscribing/message-ordering","id":"version-v1/subscribing/message-ordering","isDocsHomePage":false,"title":"Subscription with Message Ordering","description":"Messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.","source":"@site/versioned_docs/version-v1/subscribing/Message Ordering.md","sourceDirName":"subscribing","slug":"/subscribing/message-ordering","permalink":"/hfc-pubsub/v1/subscribing/message-ordering","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Message Ordering.md","version":"v1","sidebar_label":"Message Ordering","sidebarPosition":3,"frontMatter":{"id":"message-ordering","title":"Subscription with Message Ordering","sidebar_label":"Message Ordering","sidebar_position":3},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Subscriptions with Retry Policy","permalink":"/hfc-pubsub/v1/subscribing/retry-policy"},"next":{"title":"Topics","permalink":"/hfc-pubsub/v1/publishing/topics"}},{"unversionedId":"subscribing/retry-policy","id":"version-v1/subscribing/retry-policy","isDocsHomePage":false,"title":"Subscriptions with Retry Policy","description":"It is possible to define a retry configuration for a subscription:","source":"@site/versioned_docs/version-v1/subscribing/Retry Policy.md","sourceDirName":"subscribing","slug":"/subscribing/retry-policy","permalink":"/hfc-pubsub/v1/subscribing/retry-policy","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Retry Policy.md","version":"v1","sidebar_label":"Retry Policy","sidebarPosition":2,"frontMatter":{"id":"retry-policy","title":"Subscriptions with Retry Policy","sidebar_label":"Retry Policy","sidebar_position":2},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Internal Error Handling","permalink":"/hfc-pubsub/v1/subscribing/error-handling"},"next":{"title":"Subscription with Message Ordering","permalink":"/hfc-pubsub/v1/subscribing/message-ordering"}},{"unversionedId":"subscribing/subscriptions","id":"version-v1/subscribing/subscriptions","isDocsHomePage":false,"title":"Subscriptions","description":"Create a Subscriber to define a message handler for messages that are published on the corresponding topic.","source":"@site/versioned_docs/version-v1/subscribing/Subscriptions.md","sourceDirName":"subscribing","slug":"/subscribing/subscriptions","permalink":"/hfc-pubsub/v1/subscribing/subscriptions","editUrl":"https://github.com/deliveryhero/hfc-pubsub/edit/main/versioned_docs/version-v1/subscribing/Subscriptions.md","version":"v1","sidebarPosition":0,"frontMatter":{"id":"subscriptions","title":"Subscriptions","sidebar_position":0},"sidebar":"version-v1/defaultSidebar","previous":{"title":"Installation","permalink":"/hfc-pubsub/v1/getting-started/installation"},"next":{"title":"Subscriptions with a Dead-letter Policy","permalink":"/hfc-pubsub/v1/subscribing/dead-letter-policy"}}]}]}},"docusaurus-plugin-content-blog":{"default":null},"docusaurus-plugin-content-pages":{"default":null},"docusaurus-plugin-debug":{"default":null},"docusaurus-plugin-sitemap":{"default":null},"docusaurus-theme-classic":{"default":null},"undefined":{"default":null}}')}}]); \ No newline at end of file diff --git a/assets/js/24bb654f.1cfb78d3.js b/assets/js/24bb654f.1cfb78d3.js deleted file mode 100644 index daa6ef88..00000000 --- a/assets/js/24bb654f.1cfb78d3.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[7367],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>b});var i=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function a(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var p=i.createContext({}),l=function(e){var t=i.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},c=function(e){var t=l(e.components);return i.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},d=i.forwardRef((function(e,t){var r=e.components,n=e.mdxType,s=e.originalType,p=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),d=l(r),b=n,k=d["".concat(p,".").concat(b)]||d[b]||u[b]||s;return r?i.createElement(k,a(a({ref:t},c),{},{components:r})):i.createElement(k,a({ref:t},c))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var s=r.length,a=new Array(s);a[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:n,a[1]=o;for(var l=2;l{r.r(t),r.d(t,{default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>l});var i=r(7462),n=r(3366),s=(r(7294),r(3905)),a=["components"],o={id:"SubscriptionService",title:"Class: SubscriptionService",sidebar_label:"SubscriptionService",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/classes/SubscriptionService",id:"api/classes/SubscriptionService",isDocsHomePage:!1,title:"Class: SubscriptionService",description:"Constructors",source:"@site/docs/api/classes/SubscriptionService.md",sourceDirName:"api/classes",slug:"/api/classes/SubscriptionService",permalink:"/hfc-pubsub/api/classes/SubscriptionService",editUrl:null,version:"current",sidebar_label:"SubscriptionService",sidebarPosition:0,frontMatter:{id:"SubscriptionService",title:"Class: SubscriptionService",sidebar_label:"SubscriptionService",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: PubSubService",permalink:"/hfc-pubsub/api/classes/PubSubService"},next:{title:"Class: Topic

",permalink:"/hfc-pubsub/api/classes/Topic"}},l=[{value:"Constructors",id:"constructors",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties",children:[{value:"defaultSubscriberOptions",id:"defaultsubscriberoptions",children:[]},{value:"subscribers",id:"subscribers",children:[]}]},{value:"Methods",id:"methods",children:[{value:"closeAll",id:"closeall",children:[]},{value:"getSubscribers",id:"getsubscribers",children:[]},{value:"handleError",id:"handleerror",children:[]},{value:"init",id:"init",children:[]},{value:"loadSubscriptionService",id:"loadsubscriptionservice",children:[]}]}],c={toc:l};function u(e){var t=e.components,r=(0,n.Z)(e,a);return(0,s.kt)("wrapper",(0,i.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,s.kt)("h2",{id:"constructors"},"Constructors"),(0,s.kt)("h3",{id:"constructor"},"constructor"),(0,s.kt)("p",null,"\u2022 ",(0,s.kt)("strong",{parentName:"p"},"new SubscriptionService"),"()"),(0,s.kt)("h4",{id:"defined-in"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L23"},"src/service/subscription.ts:23")),(0,s.kt)("h2",{id:"properties"},"Properties"),(0,s.kt)("h3",{id:"defaultsubscriberoptions"},"defaultSubscriberOptions"),(0,s.kt)("p",null,"\u25aa ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"defaultSubscriberOptions"),": ",(0,s.kt)("a",{parentName:"p",href:"../interfaces/SubscriberOptions"},(0,s.kt)("inlineCode",{parentName:"a"},"SubscriberOptions"))),(0,s.kt)("p",null,"All subscriptions will inherit from this default options object"),(0,s.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L21"},"src/service/subscription.ts:21")),(0,s.kt)("hr",null),(0,s.kt)("h3",{id:"subscribers"},"subscribers"),(0,s.kt)("p",null,"\u25aa ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"subscribers"),": ",(0,s.kt)("a",{parentName:"p",href:"../interfaces/SubscriberObject"},(0,s.kt)("inlineCode",{parentName:"a"},"SubscriberObject")),"<",(0,s.kt)("inlineCode",{parentName:"p"},"any"),">","[] = ",(0,s.kt)("inlineCode",{parentName:"p"},"[]")),(0,s.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L14"},"src/service/subscription.ts:14")),(0,s.kt)("h2",{id:"methods"},"Methods"),(0,s.kt)("h3",{id:"closeall"},"closeAll"),(0,s.kt)("p",null,"\u25b8 ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"closeAll"),"(): ",(0,s.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,s.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,s.kt)("p",null,"Call this function from a process exit handler to close all current subscriptions"),(0,s.kt)("h4",{id:"returns"},"Returns"),(0,s.kt)("p",null,(0,s.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,s.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,s.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L64"},"src/service/subscription.ts:64")),(0,s.kt)("hr",null),(0,s.kt)("h3",{id:"getsubscribers"},"getSubscribers"),(0,s.kt)("p",null,"\u25b8 ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"getSubscribers"),"(): ",(0,s.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,s.kt)("h4",{id:"returns-1"},"Returns"),(0,s.kt)("p",null,(0,s.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,s.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L68"},"src/service/subscription.ts:68")),(0,s.kt)("hr",null),(0,s.kt)("h3",{id:"handleerror"},"handleError"),(0,s.kt)("p",null,"\u25b8 ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"handleError"),"(",(0,s.kt)("inlineCode",{parentName:"p"},"error"),", ",(0,s.kt)("inlineCode",{parentName:"p"},"metadata"),"): ",(0,s.kt)("inlineCode",{parentName:"p"},"void")),(0,s.kt)("p",null,"If passed, it would serve as the default error handler for all subscriptions.\nApplications should override this with custom error handling: log error, cleanup resources and exit the process.\nDefault logs the error and ",(0,s.kt)("strong",{parentName:"p"},"rethrows")),(0,s.kt)("h4",{id:"parameters"},"Parameters"),(0,s.kt)("table",null,(0,s.kt)("thead",{parentName:"table"},(0,s.kt)("tr",{parentName:"thead"},(0,s.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,s.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,s.kt)("tbody",{parentName:"table"},(0,s.kt)("tr",{parentName:"tbody"},(0,s.kt)("td",{parentName:"tr",align:"left"},(0,s.kt)("inlineCode",{parentName:"td"},"error")),(0,s.kt)("td",{parentName:"tr",align:"left"},(0,s.kt)("inlineCode",{parentName:"td"},"Error"))),(0,s.kt)("tr",{parentName:"tbody"},(0,s.kt)("td",{parentName:"tr",align:"left"},(0,s.kt)("inlineCode",{parentName:"td"},"metadata")),(0,s.kt)("td",{parentName:"tr",align:"left"},(0,s.kt)("a",{parentName:"td",href:"../interfaces/SubscriberMetadata"},(0,s.kt)("inlineCode",{parentName:"a"},"SubscriberMetadata")))))),(0,s.kt)("h4",{id:"returns-2"},"Returns"),(0,s.kt)("p",null,(0,s.kt)("inlineCode",{parentName:"p"},"void")),(0,s.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L51"},"src/service/subscription.ts:51")),(0,s.kt)("hr",null),(0,s.kt)("h3",{id:"init"},"init"),(0,s.kt)("p",null,"\u25b8 ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"init"),"(): ",(0,s.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,s.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,s.kt)("p",null,"Can be used to initialize process level globals (like DB Connections).\nDefault is a no-op"),(0,s.kt)("h4",{id:"returns-3"},"Returns"),(0,s.kt)("p",null,(0,s.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,s.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,s.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L42"},"src/service/subscription.ts:42")),(0,s.kt)("hr",null),(0,s.kt)("h3",{id:"loadsubscriptionservice"},"loadSubscriptionService"),(0,s.kt)("p",null,"\u25b8 ",(0,s.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,s.kt)("strong",{parentName:"p"},"loadSubscriptionService"),"(): typeof ",(0,s.kt)("a",{parentName:"p",href:"SubscriptionService"},(0,s.kt)("inlineCode",{parentName:"a"},"SubscriptionService"))),(0,s.kt)("h4",{id:"returns-4"},"Returns"),(0,s.kt)("p",null,"typeof ",(0,s.kt)("a",{parentName:"p",href:"SubscriptionService"},(0,s.kt)("inlineCode",{parentName:"a"},"SubscriptionService"))),(0,s.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,s.kt)("p",null,(0,s.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/subscription.ts#L112"},"src/service/subscription.ts:112")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/24bb654f.e76d3000.js b/assets/js/24bb654f.e76d3000.js new file mode 100644 index 00000000..afa6211e --- /dev/null +++ b/assets/js/24bb654f.e76d3000.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[7367],{3905:(e,t,r)=>{r.d(t,{Zo:()=>c,kt:()=>b});var i=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function s(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var p=i.createContext({}),l=function(e){var t=i.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},c=function(e){var t=l(e.components);return i.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.createElement(i.Fragment,{},t)}},d=i.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,p=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),d=l(r),b=n,k=d["".concat(p,".").concat(b)]||d[b]||u[b]||a;return r?i.createElement(k,s(s({ref:t},c),{},{components:r})):i.createElement(k,s({ref:t},c))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,s=new Array(a);s[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:n,s[1]=o;for(var l=2;l{r.r(t),r.d(t,{default:()=>u,frontMatter:()=>o,metadata:()=>p,toc:()=>l});var i=r(7462),n=r(3366),a=(r(7294),r(3905)),s=["components"],o={id:"SubscriptionService",title:"Class: SubscriptionService",sidebar_label:"SubscriptionService",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/classes/SubscriptionService",id:"api/classes/SubscriptionService",isDocsHomePage:!1,title:"Class: SubscriptionService",description:"Constructors",source:"@site/docs/api/classes/SubscriptionService.md",sourceDirName:"api/classes",slug:"/api/classes/SubscriptionService",permalink:"/hfc-pubsub/api/classes/SubscriptionService",editUrl:null,version:"current",sidebar_label:"SubscriptionService",sidebarPosition:0,frontMatter:{id:"SubscriptionService",title:"Class: SubscriptionService",sidebar_label:"SubscriptionService",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: PubSubService",permalink:"/hfc-pubsub/api/classes/PubSubService"},next:{title:"Class: Topic

",permalink:"/hfc-pubsub/api/classes/Topic"}},l=[{value:"Constructors",id:"constructors",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties",children:[{value:"defaultSubscriberOptions",id:"defaultsubscriberoptions",children:[]},{value:"subscribers",id:"subscribers",children:[]}]},{value:"Methods",id:"methods",children:[{value:"closeAll",id:"closeall",children:[]},{value:"getSubscribers",id:"getsubscribers",children:[]},{value:"handleError",id:"handleerror",children:[]},{value:"init",id:"init",children:[]},{value:"loadSubscriptionService",id:"loadsubscriptionservice",children:[]}]}],c={toc:l};function u(e){var t=e.components,r=(0,n.Z)(e,s);return(0,a.kt)("wrapper",(0,i.Z)({},c,r,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"constructors"},"Constructors"),(0,a.kt)("h3",{id:"constructor"},"constructor"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("strong",{parentName:"p"},"new SubscriptionService"),"()"),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L23"},"src/service/subscription.ts:23")),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"defaultsubscriberoptions"},"defaultSubscriberOptions"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"defaultSubscriberOptions"),": ",(0,a.kt)("a",{parentName:"p",href:"../interfaces/SubscriberOptions"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriberOptions"))),(0,a.kt)("p",null,"All subscriptions will inherit from this default options object"),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L21"},"src/service/subscription.ts:21")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"subscribers"},"subscribers"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"subscribers"),": ",(0,a.kt)("a",{parentName:"p",href:"../interfaces/SubscriberObject"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriberObject")),"<",(0,a.kt)("inlineCode",{parentName:"p"},"any"),">","[] = ",(0,a.kt)("inlineCode",{parentName:"p"},"[]")),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L14"},"src/service/subscription.ts:14")),(0,a.kt)("h2",{id:"methods"},"Methods"),(0,a.kt)("h3",{id:"closeall"},"closeAll"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"closeAll"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("p",null,"Call this function from a process exit handler to close all current subscriptions"),(0,a.kt)("h4",{id:"returns"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L64"},"src/service/subscription.ts:64")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getsubscribers"},"getSubscribers"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"getSubscribers"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,a.kt)("h4",{id:"returns-1"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,a.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L68"},"src/service/subscription.ts:68")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"handleerror"},"handleError"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"handleError"),"(",(0,a.kt)("inlineCode",{parentName:"p"},"err"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"metadata"),"): ",(0,a.kt)("inlineCode",{parentName:"p"},"void")),(0,a.kt)("p",null,"If passed, it would serve as the default error handler for all subscriptions.\nApplications should override this with custom error handling: log error, cleanup resources and exit the process.\nDefault logs the error and ",(0,a.kt)("strong",{parentName:"p"},"rethrows")),(0,a.kt)("h4",{id:"parameters"},"Parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"err")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Error"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"metadata")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("a",{parentName:"td",href:"../interfaces/SubscriberMetadata"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriberMetadata")))))),(0,a.kt)("h4",{id:"returns-2"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"void")),(0,a.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L51"},"src/service/subscription.ts:51")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"init"},"init"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"init"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("p",null,"Can be used to initialize process level globals (like DB Connections).\nDefault is a no-op"),(0,a.kt)("h4",{id:"returns-3"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L42"},"src/service/subscription.ts:42")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"loadsubscriptionservice"},"loadSubscriptionService"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"loadSubscriptionService"),"(): typeof ",(0,a.kt)("a",{parentName:"p",href:"SubscriptionService"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriptionService"))),(0,a.kt)("h4",{id:"returns-4"},"Returns"),(0,a.kt)("p",null,"typeof ",(0,a.kt)("a",{parentName:"p",href:"SubscriptionService"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriptionService"))),(0,a.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/subscription.ts#L112"},"src/service/subscription.ts:112")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5e8c322a.6ea76047.js b/assets/js/5e8c322a.39808287.js similarity index 76% rename from assets/js/5e8c322a.6ea76047.js rename to assets/js/5e8c322a.39808287.js index a9f1c2ec..e00415ce 100644 --- a/assets/js/5e8c322a.6ea76047.js +++ b/assets/js/5e8c322a.39808287.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[7597],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>m});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),o=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},u=function(e){var t=o(e.components);return n.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),d=o(r),m=a,f=d["".concat(s,".").concat(m)]||d[m]||c[m]||i;return r?n.createElement(f,l(l({ref:t},u),{},{components:r})):n.createElement(f,l({ref:t},u))}));function m(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,l=new Array(i);l[0]=d;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p.mdxType="string"==typeof e?e:a,l[1]=p;for(var o=2;o{r.r(t),r.d(t,{default:()=>c,frontMatter:()=>p,metadata:()=>s,toc:()=>o});var n=r(7462),a=r(3366),i=(r(7294),r(3905)),l=["components"],p={id:"index",title:"@honestfoodcompany/pubsub",slug:"/api/",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},s={unversionedId:"api/index",id:"api/index",isDocsHomePage:!1,title:"@honestfoodcompany/pubsub",description:"Classes",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/hfc-pubsub/api/",editUrl:null,version:"current",sidebar_label:"Exports",sidebarPosition:.5,frontMatter:{id:"index",title:"@honestfoodcompany/pubsub",slug:"/api/",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Other Options",permalink:"/hfc-pubsub/options"},next:{title:"Class: Message",permalink:"/hfc-pubsub/api/classes/Message"}},o=[{value:"Classes",id:"classes",children:[]},{value:"Interfaces",id:"interfaces",children:[]},{value:"Functions",id:"functions",children:[{value:"isGzipCompressed",id:"isgzipcompressed",children:[]},{value:"setLogger",id:"setlogger",children:[]}]}],u={toc:o};function c(e){var t=e.components,r=(0,a.Z)(e,l);return(0,i.kt)("wrapper",(0,n.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"classes"},"Classes"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/Message"},"Message")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/PubSubService"},"PubSubService")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/SubscriptionService"},"SubscriptionService")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/Topic"},"Topic"))),(0,i.kt)("h2",{id:"interfaces"},"Interfaces"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/Payload"},"Payload")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/SubscriberMetadata"},"SubscriberMetadata")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/SubscriberObject"},"SubscriberObject")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/SubscriberOptions"},"SubscriberOptions")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/TopicOptions"},"TopicOptions"))),(0,i.kt)("h2",{id:"functions"},"Functions"),(0,i.kt)("h3",{id:"isgzipcompressed"},"isGzipCompressed"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Const")," ",(0,i.kt)("strong",{parentName:"p"},"isGzipCompressed"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"buf"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"boolean")),(0,i.kt)("p",null,"gzip files contain a 10-byte header, containing a:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"magic number (1f 8b)"),(0,i.kt)("li",{parentName:"ul"},"the compression method (08 for DEFLATE)"),(0,i.kt)("li",{parentName:"ul"},"1-byte of header flags, a 4-byte timestamp, compression flags and the operating system ID.")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},(0,i.kt)("inlineCode",{parentName:"strong"},"see"))," ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Gzip#File_format"},"https://en.wikipedia.org/wiki/Gzip#File_format")),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"buf")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"Buffer"))))),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"boolean")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/gzip.ts#L9"},"src/message/gzip.ts:9")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"setlogger"},"setLogger"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Const")," ",(0,i.kt)("strong",{parentName:"p"},"setLogger"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"logger"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"logger")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"LoggerOptions"))))),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/logger.ts#L16"},"src/service/logger.ts:16")))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[7597],{3905:(e,t,r)=>{r.d(t,{Zo:()=>u,kt:()=>m});var a=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=a.createContext({}),o=function(e){var t=a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},u=function(e){var t=o(e.components);return a.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,s=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),d=o(r),m=n,f=d["".concat(s,".").concat(m)]||d[m]||c[m]||i;return r?a.createElement(f,l(l({ref:t},u),{},{components:r})):a.createElement(f,l({ref:t},u))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,l=new Array(i);l[0]=d;var p={};for(var s in t)hasOwnProperty.call(t,s)&&(p[s]=t[s]);p.originalType=e,p.mdxType="string"==typeof e?e:n,l[1]=p;for(var o=2;o{r.r(t),r.d(t,{default:()=>c,frontMatter:()=>p,metadata:()=>s,toc:()=>o});var a=r(7462),n=r(3366),i=(r(7294),r(3905)),l=["components"],p={id:"index",title:"@honestfoodcompany/pubsub",slug:"/api/",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},s={unversionedId:"api/index",id:"api/index",isDocsHomePage:!1,title:"@honestfoodcompany/pubsub",description:"Classes",source:"@site/docs/api/index.md",sourceDirName:"api",slug:"/api/",permalink:"/hfc-pubsub/api/",editUrl:null,version:"current",sidebar_label:"Exports",sidebarPosition:.5,frontMatter:{id:"index",title:"@honestfoodcompany/pubsub",slug:"/api/",sidebar_label:"Exports",sidebar_position:.5,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Other Options",permalink:"/hfc-pubsub/options"},next:{title:"Class: Message",permalink:"/hfc-pubsub/api/classes/Message"}},o=[{value:"Classes",id:"classes",children:[]},{value:"Interfaces",id:"interfaces",children:[]},{value:"Functions",id:"functions",children:[{value:"isGzipCompressed",id:"isgzipcompressed",children:[]},{value:"setLogger",id:"setlogger",children:[]}]}],u={toc:o};function c(e){var t=e.components,r=(0,n.Z)(e,l);return(0,i.kt)("wrapper",(0,a.Z)({},u,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"classes"},"Classes"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/Message"},"Message")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/PubSubService"},"PubSubService")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/SubscriptionService"},"SubscriptionService")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"classes/Topic"},"Topic"))),(0,i.kt)("h2",{id:"interfaces"},"Interfaces"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/Payload"},"Payload")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/SubscriberMetadata"},"SubscriberMetadata")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/SubscriberObject"},"SubscriberObject")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/SubscriberOptions"},"SubscriberOptions")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("a",{parentName:"li",href:"interfaces/TopicOptions"},"TopicOptions"))),(0,i.kt)("h2",{id:"functions"},"Functions"),(0,i.kt)("h3",{id:"isgzipcompressed"},"isGzipCompressed"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Const")," ",(0,i.kt)("strong",{parentName:"p"},"isGzipCompressed"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"buf"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"boolean")),(0,i.kt)("p",null,"gzip files contain a 10-byte header, containing a:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"magic number (1f 8b)"),(0,i.kt)("li",{parentName:"ul"},"the compression method (08 for DEFLATE)"),(0,i.kt)("li",{parentName:"ul"},"1-byte of header flags, a 4-byte timestamp, compression flags and the operating system ID.")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},(0,i.kt)("inlineCode",{parentName:"strong"},"see"))," ",(0,i.kt)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/Gzip#File_format"},"https://en.wikipedia.org/wiki/Gzip#File_format")),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"buf")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"Buffer"))))),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"boolean")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/gzip.ts#L9"},"src/message/gzip.ts:9")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"setlogger"},"setLogger"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Const")," ",(0,i.kt)("strong",{parentName:"p"},"setLogger"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"logger"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"logger")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"LoggerOptions"))))),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/logger.ts#L48"},"src/service/logger.ts:48")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5f9e1e26.c9875a14.js b/assets/js/5f9e1e26.39d5b5a3.js similarity index 90% rename from assets/js/5f9e1e26.c9875a14.js rename to assets/js/5f9e1e26.39d5b5a3.js index c34b34c6..782fb774 100644 --- a/assets/js/5f9e1e26.c9875a14.js +++ b/assets/js/5f9e1e26.39d5b5a3.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[1535],{3905:(e,t,n)=>{n.d(t,{Zo:()=>o,kt:()=>c});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=r.createContext({}),u=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},o=function(e){var t=u(e.components);return r.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,p=e.parentName,o=s(e,["components","mdxType","originalType","parentName"]),b=u(n),c=i,k=b["".concat(p,".").concat(c)]||b[c]||d[c]||a;return n?r.createElement(k,l(l({ref:t},o),{},{components:n})):r.createElement(k,l({ref:t},o))}));function c(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,l=new Array(a);l[0]=b;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeof e?e:i,l[1]=s;for(var u=2;u{n.r(t),n.d(t,{default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>u});var r=n(7462),i=n(3366),a=(n(7294),n(3905)),l=["components"],s={id:"PubSubService",title:"Class: PubSubService",sidebar_label:"PubSubService",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/classes/PubSubService",id:"api/classes/PubSubService",isDocsHomePage:!1,title:"Class: PubSubService",description:"Properties",source:"@site/docs/api/classes/PubSubService.md",sourceDirName:"api/classes",slug:"/api/classes/PubSubService",permalink:"/hfc-pubsub/api/classes/PubSubService",editUrl:null,version:"current",sidebar_label:"PubSubService",sidebarPosition:0,frontMatter:{id:"PubSubService",title:"Class: PubSubService",sidebar_label:"PubSubService",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: Message",permalink:"/hfc-pubsub/api/classes/Message"},next:{title:"Class: SubscriptionService",permalink:"/hfc-pubsub/api/classes/SubscriptionService"}},u=[{value:"Properties",id:"properties",children:[{value:"client",id:"client",children:[]},{value:"driver",id:"driver",children:[]},{value:"instance",id:"instance",children:[]}]},{value:"Methods",id:"methods",children:[{value:"closeAll",id:"closeall",children:[]},{value:"getAllSubscriptions",id:"getallsubscriptions",children:[]},{value:"getSubscribers",id:"getsubscribers",children:[]},{value:"initClient",id:"initclient",children:[]},{value:"publish",id:"publish",children:[]},{value:"startSubscriptions",id:"startsubscriptions",children:[]},{value:"subscribe",id:"subscribe",children:[]},{value:"getInstance",id:"getinstance",children:[]},{value:"isHealthy",id:"ishealthy",children:[]}]}],o={toc:u};function d(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,r.Z)({},o,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"client"},"client"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("inlineCode",{parentName:"p"},"Protected")," ",(0,a.kt)("strong",{parentName:"p"},"client"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"PubSubClientV2")),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L13"},"src/service/pubsub.ts:13")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"driver"},"driver"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("inlineCode",{parentName:"p"},"Protected")," ",(0,a.kt)("strong",{parentName:"p"},"driver"),": ",(0,a.kt)("inlineCode",{parentName:"p"},'"synchronous"')," ","|"," ",(0,a.kt)("inlineCode",{parentName:"p"},'"google"')),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L15"},"src/service/pubsub.ts:15")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"instance"},"instance"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("inlineCode",{parentName:"p"},"Protected")," ",(0,a.kt)("strong",{parentName:"p"},"instance"),": ",(0,a.kt)("a",{parentName:"p",href:"PubSubService"},(0,a.kt)("inlineCode",{parentName:"a"},"PubSubService"))),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L14"},"src/service/pubsub.ts:14")),(0,a.kt)("h2",{id:"methods"},"Methods"),(0,a.kt)("h3",{id:"closeall"},"closeAll"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"closeAll"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"returns"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L129"},"src/service/pubsub.ts:129")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getallsubscriptions"},"getAllSubscriptions"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"getAllSubscriptions"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"AllSubscriptions"),"[]",">"),(0,a.kt)("p",null,"Retrieves a list of subscribers"),(0,a.kt)("h4",{id:"returns-1"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"AllSubscriptions"),"[]",">"),(0,a.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L218"},"src/service/pubsub.ts:218")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getsubscribers"},"getSubscribers"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"getSubscribers"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,a.kt)("h4",{id:"returns-2"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,a.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L125"},"src/service/pubsub.ts:125")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"initclient"},"initClient"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"initClient"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"void")),(0,a.kt)("h4",{id:"returns-3"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"void")),(0,a.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L90"},"src/service/pubsub.ts:90")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"publish"},"publish"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"publish"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"T"),">","(",(0,a.kt)("inlineCode",{parentName:"p"},"topic"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"message"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"options?"),"): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,a.kt)("p",null,"Publishes new orders to PubSub."),(0,a.kt)("h4",{id:"type-parameters"},"Type parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"T")),(0,a.kt)("td",{parentName:"tr",align:"left"},"extends ",(0,a.kt)("inlineCode",{parentName:"td"},"TopicProperties"))))),(0,a.kt)("h4",{id:"parameters"},"Parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"topic")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"T"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"message")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Record"),"<",(0,a.kt)("inlineCode",{parentName:"td"},"string"),", ",(0,a.kt)("inlineCode",{parentName:"td"},"unknown"),">")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"options?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"PublishOptions"))))),(0,a.kt)("h4",{id:"returns-4"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,a.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L108"},"src/service/pubsub.ts:108")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"startsubscriptions"},"startSubscriptions"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"startSubscriptions"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"returns-5"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-8"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L148"},"src/service/pubsub.ts:148")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"subscribe"},"subscribe"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"subscribe"),"(",(0,a.kt)("inlineCode",{parentName:"p"},"subscription"),"): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("p",null,"Subscribes to any given topic"),(0,a.kt)("h4",{id:"parameters-1"},"Parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"subscription")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"SubscriberTuple"))))),(0,a.kt)("h4",{id:"returns-6"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-9"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L211"},"src/service/pubsub.ts:211")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getinstance"},"getInstance"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"getInstance"),"(): ",(0,a.kt)("a",{parentName:"p",href:"PubSubService"},(0,a.kt)("inlineCode",{parentName:"a"},"PubSubService"))),(0,a.kt)("h4",{id:"returns-7"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"PubSubService"},(0,a.kt)("inlineCode",{parentName:"a"},"PubSubService"))),(0,a.kt)("h4",{id:"defined-in-10"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L98"},"src/service/pubsub.ts:98")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"ishealthy"},"isHealthy"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"isHealthy"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"returns-8"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"defined-in-11"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/service/pubsub.ts#L49"},"src/service/pubsub.ts:49")))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[1535],{3905:(e,t,n)=>{n.d(t,{Zo:()=>o,kt:()=>c});var r=n(7294);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=r.createContext({}),u=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},o=function(e){var t=u(e.components);return r.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},b=r.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,p=e.parentName,o=s(e,["components","mdxType","originalType","parentName"]),b=u(n),c=i,k=b["".concat(p,".").concat(c)]||b[c]||d[c]||a;return n?r.createElement(k,l(l({ref:t},o),{},{components:n})):r.createElement(k,l({ref:t},o))}));function c(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,l=new Array(a);l[0]=b;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeof e?e:i,l[1]=s;for(var u=2;u{n.r(t),n.d(t,{default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>u});var r=n(7462),i=n(3366),a=(n(7294),n(3905)),l=["components"],s={id:"PubSubService",title:"Class: PubSubService",sidebar_label:"PubSubService",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/classes/PubSubService",id:"api/classes/PubSubService",isDocsHomePage:!1,title:"Class: PubSubService",description:"Properties",source:"@site/docs/api/classes/PubSubService.md",sourceDirName:"api/classes",slug:"/api/classes/PubSubService",permalink:"/hfc-pubsub/api/classes/PubSubService",editUrl:null,version:"current",sidebar_label:"PubSubService",sidebarPosition:0,frontMatter:{id:"PubSubService",title:"Class: PubSubService",sidebar_label:"PubSubService",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: Message",permalink:"/hfc-pubsub/api/classes/Message"},next:{title:"Class: SubscriptionService",permalink:"/hfc-pubsub/api/classes/SubscriptionService"}},u=[{value:"Properties",id:"properties",children:[{value:"client",id:"client",children:[]},{value:"driver",id:"driver",children:[]},{value:"instance",id:"instance",children:[]}]},{value:"Methods",id:"methods",children:[{value:"closeAll",id:"closeall",children:[]},{value:"getAllSubscriptions",id:"getallsubscriptions",children:[]},{value:"getSubscribers",id:"getsubscribers",children:[]},{value:"initClient",id:"initclient",children:[]},{value:"publish",id:"publish",children:[]},{value:"startSubscriptions",id:"startsubscriptions",children:[]},{value:"subscribe",id:"subscribe",children:[]},{value:"getInstance",id:"getinstance",children:[]},{value:"isHealthy",id:"ishealthy",children:[]}]}],o={toc:u};function d(e){var t=e.components,n=(0,i.Z)(e,l);return(0,a.kt)("wrapper",(0,r.Z)({},o,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"client"},"client"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("inlineCode",{parentName:"p"},"Protected")," ",(0,a.kt)("strong",{parentName:"p"},"client"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"PubSubClientV2")),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L13"},"src/service/pubsub.ts:13")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"driver"},"driver"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("inlineCode",{parentName:"p"},"Protected")," ",(0,a.kt)("strong",{parentName:"p"},"driver"),": ",(0,a.kt)("inlineCode",{parentName:"p"},'"synchronous"')," ","|"," ",(0,a.kt)("inlineCode",{parentName:"p"},'"google"')),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L15"},"src/service/pubsub.ts:15")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"instance"},"instance"),(0,a.kt)("p",null,"\u25aa ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("inlineCode",{parentName:"p"},"Protected")," ",(0,a.kt)("strong",{parentName:"p"},"instance"),": ",(0,a.kt)("a",{parentName:"p",href:"PubSubService"},(0,a.kt)("inlineCode",{parentName:"a"},"PubSubService"))),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L14"},"src/service/pubsub.ts:14")),(0,a.kt)("h2",{id:"methods"},"Methods"),(0,a.kt)("h3",{id:"closeall"},"closeAll"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"closeAll"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"returns"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L123"},"src/service/pubsub.ts:123")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getallsubscriptions"},"getAllSubscriptions"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"getAllSubscriptions"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"AllSubscriptions"),"[]",">"),(0,a.kt)("p",null,"Retrieves a list of subscribers"),(0,a.kt)("h4",{id:"returns-1"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"AllSubscriptions"),"[]",">"),(0,a.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L213"},"src/service/pubsub.ts:213")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getsubscribers"},"getSubscribers"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"getSubscribers"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,a.kt)("h4",{id:"returns-2"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Subscribers")),(0,a.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L119"},"src/service/pubsub.ts:119")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"initclient"},"initClient"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"initClient"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"void")),(0,a.kt)("h4",{id:"returns-3"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"void")),(0,a.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L84"},"src/service/pubsub.ts:84")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"publish"},"publish"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"publish"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"T"),">","(",(0,a.kt)("inlineCode",{parentName:"p"},"topic"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"message"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"options?"),"): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,a.kt)("p",null,"Publishes new orders to PubSub."),(0,a.kt)("h4",{id:"type-parameters"},"Type parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"T")),(0,a.kt)("td",{parentName:"tr",align:"left"},"extends ",(0,a.kt)("inlineCode",{parentName:"td"},"TopicProperties"))))),(0,a.kt)("h4",{id:"parameters"},"Parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"topic")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"T"))),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"message")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"Record"),"<",(0,a.kt)("inlineCode",{parentName:"td"},"string"),", ",(0,a.kt)("inlineCode",{parentName:"td"},"unknown"),">")),(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"options?")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"PublishOptions"))))),(0,a.kt)("h4",{id:"returns-4"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,a.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L102"},"src/service/pubsub.ts:102")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"startsubscriptions"},"startSubscriptions"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"startSubscriptions"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"returns-5"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-8"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L144"},"src/service/pubsub.ts:144")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"subscribe"},"subscribe"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("strong",{parentName:"p"},"subscribe"),"(",(0,a.kt)("inlineCode",{parentName:"p"},"subscription"),"): ",(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("p",null,"Subscribes to any given topic"),(0,a.kt)("h4",{id:"parameters-1"},"Parameters"),(0,a.kt)("table",null,(0,a.kt)("thead",{parentName:"table"},(0,a.kt)("tr",{parentName:"thead"},(0,a.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,a.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,a.kt)("tbody",{parentName:"table"},(0,a.kt)("tr",{parentName:"tbody"},(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"subscription")),(0,a.kt)("td",{parentName:"tr",align:"left"},(0,a.kt)("inlineCode",{parentName:"td"},"SubscriberTuple"))))),(0,a.kt)("h4",{id:"returns-6"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,a.kt)("inlineCode",{parentName:"p"},"void"),">"),(0,a.kt)("h4",{id:"defined-in-9"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L206"},"src/service/pubsub.ts:206")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"getinstance"},"getInstance"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"getInstance"),"(): ",(0,a.kt)("a",{parentName:"p",href:"PubSubService"},(0,a.kt)("inlineCode",{parentName:"a"},"PubSubService"))),(0,a.kt)("h4",{id:"returns-7"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"PubSubService"},(0,a.kt)("inlineCode",{parentName:"a"},"PubSubService"))),(0,a.kt)("h4",{id:"defined-in-10"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L92"},"src/service/pubsub.ts:92")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"ishealthy"},"isHealthy"),(0,a.kt)("p",null,"\u25b8 ",(0,a.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,a.kt)("strong",{parentName:"p"},"isHealthy"),"(): ",(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"returns-8"},"Returns"),(0,a.kt)("p",null,(0,a.kt)("inlineCode",{parentName:"p"},"boolean")),(0,a.kt)("h4",{id:"defined-in-11"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/service/pubsub.ts#L48"},"src/service/pubsub.ts:48")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6401c6ac.3ff4cca2.js b/assets/js/6401c6ac.bf35ce5c.js similarity index 51% rename from assets/js/6401c6ac.3ff4cca2.js rename to assets/js/6401c6ac.bf35ce5c.js index 61795f3e..651ac3f6 100644 --- a/assets/js/6401c6ac.3ff4cca2.js +++ b/assets/js/6401c6ac.bf35ce5c.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[1581],{3905:(e,t,a)=>{a.d(t,{Zo:()=>s,kt:()=>k});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function p(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),d=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):p(p({},t),e)),a},s=function(e){var t=d(e.components);return n.createElement(o.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),m=d(a),k=r,u=m["".concat(o,".").concat(k)]||m[k]||c[k]||i;return a?n.createElement(u,p(p({ref:t},s),{},{components:a})):n.createElement(u,p({ref:t},s))}));function k(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,p=new Array(i);p[0]=m;var l={};for(var o in t)hasOwnProperty.call(t,o)&&(l[o]=t[o]);l.originalType=e,l.mdxType="string"==typeof e?e:r,p[1]=l;for(var d=2;d{a.r(t),a.d(t,{default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>d});var n=a(7462),r=a(3366),i=(a(7294),a(3905)),p=["components"],l={id:"Topic",title:"Class: Topic

",sidebar_label:"Topic",sidebar_position:0,custom_edit_url:null},o={unversionedId:"api/classes/Topic",id:"api/classes/Topic",isDocsHomePage:!1,title:"Class: Topic

",description:"Type parameters",source:"@site/docs/api/classes/Topic.md",sourceDirName:"api/classes",slug:"/api/classes/Topic",permalink:"/hfc-pubsub/api/classes/Topic",editUrl:null,version:"current",sidebar_label:"Topic",sidebarPosition:0,frontMatter:{id:"Topic",title:"Class: Topic

",sidebar_label:"Topic",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: SubscriptionService",permalink:"/hfc-pubsub/api/classes/SubscriptionService"},next:{title:"Interface: Payload",permalink:"/hfc-pubsub/api/interfaces/Payload"}},d=[{value:"Type parameters",id:"type-parameters",children:[]},{value:"Constructors",id:"constructors",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties",children:[{value:"options",id:"options",children:[]},{value:"project",id:"project",children:[]},{value:"topicName",id:"topicname",children:[]}]},{value:"Methods",id:"methods",children:[{value:"publish",id:"publish",children:[]},{value:"validateMessage",id:"validatemessage",children:[]},{value:"validateTopic",id:"validatetopic",children:[]}]}],s={toc:d};function c(e){var t=e.components,a=(0,r.Z)(e,p);return(0,i.kt)("wrapper",(0,n.Z)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"type-parameters"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"P")),(0,i.kt)("td",{parentName:"tr",align:"left"},"extends ",(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")),(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")))))),(0,i.kt)("h2",{id:"constructors"},"Constructors"),(0,i.kt)("h3",{id:"constructor"},"constructor"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"new Topic"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"P"),">","()"),(0,i.kt)("h4",{id:"type-parameters-1"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"P")),(0,i.kt)("td",{parentName:"tr",align:"left"},"extends ",(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")),(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")))))),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L59"},"src/topic/index.ts:59")),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"options"},"options"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"options"),": ",(0,i.kt)("a",{parentName:"p",href:"../interfaces/TopicOptions"},(0,i.kt)("inlineCode",{parentName:"a"},"TopicOptions"))),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L42"},"src/topic/index.ts:42")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"project"},"project"),(0,i.kt)("p",null,"\u25aa ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"project"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"GooglePubSubProject")),(0,i.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L40"},"src/topic/index.ts:40")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"topicname"},"topicName"),(0,i.kt)("p",null,"\u25aa ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("inlineCode",{parentName:"p"},"Readonly")," ",(0,i.kt)("strong",{parentName:"p"},"topicName"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L39"},"src/topic/index.ts:39")),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"publish"},"publish"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"publish"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"options?"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"PayloadInput"),"<",(0,i.kt)("inlineCode",{parentName:"td"},"P"),">")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"options?")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"TopicPublishOptions"))))),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,i.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L85"},"src/topic/index.ts:85")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"validatemessage"},"validateMessage"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"validateMessage"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"This is run before publishing any messages, it is a no-op by default.\nCan overwrite to perform checks against payload before publishing"),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"PayloadInput"),"<",(0,i.kt)("inlineCode",{parentName:"td"},"P"),">"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Message to be published")))),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L81"},"src/topic/index.ts:81")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"validatetopic"},"validateTopic"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("strong",{parentName:"p"},"validateTopic"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"name"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"This is run once when Topic is init to verify topic name"),(0,i.kt)("h4",{id:"parameters-2"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"name")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"string")),(0,i.kt)("td",{parentName:"tr",align:"left"},"topicName")))),(0,i.kt)("h4",{id:"returns-2"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/topic/index.ts#L70"},"src/topic/index.ts:70")))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[1581],{3905:(e,t,a)=>{a.d(t,{Zo:()=>s,kt:()=>k});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function p(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var o=n.createContext({}),d=function(e){var t=n.useContext(o),a=t;return e&&(a="function"==typeof e?e(t):p(p({},t),e)),a},s=function(e){var t=d(e.components);return n.createElement(o.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},m=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),m=d(a),k=r,u=m["".concat(o,".").concat(k)]||m[k]||c[k]||i;return a?n.createElement(u,p(p({ref:t},s),{},{components:a})):n.createElement(u,p({ref:t},s))}));function k(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,p=new Array(i);p[0]=m;var l={};for(var o in t)hasOwnProperty.call(t,o)&&(l[o]=t[o]);l.originalType=e,l.mdxType="string"==typeof e?e:r,p[1]=l;for(var d=2;d{a.r(t),a.d(t,{default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>d});var n=a(7462),r=a(3366),i=(a(7294),a(3905)),p=["components"],l={id:"Topic",title:"Class: Topic

",sidebar_label:"Topic",sidebar_position:0,custom_edit_url:null},o={unversionedId:"api/classes/Topic",id:"api/classes/Topic",isDocsHomePage:!1,title:"Class: Topic

",description:"Type parameters",source:"@site/docs/api/classes/Topic.md",sourceDirName:"api/classes",slug:"/api/classes/Topic",permalink:"/hfc-pubsub/api/classes/Topic",editUrl:null,version:"current",sidebar_label:"Topic",sidebarPosition:0,frontMatter:{id:"Topic",title:"Class: Topic

",sidebar_label:"Topic",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Class: SubscriptionService",permalink:"/hfc-pubsub/api/classes/SubscriptionService"},next:{title:"Interface: Payload",permalink:"/hfc-pubsub/api/interfaces/Payload"}},d=[{value:"Type parameters",id:"type-parameters",children:[]},{value:"Constructors",id:"constructors",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties",children:[{value:"options",id:"options",children:[]},{value:"project",id:"project",children:[]},{value:"topicName",id:"topicname",children:[]}]},{value:"Methods",id:"methods",children:[{value:"publish",id:"publish",children:[]},{value:"validateMessage",id:"validatemessage",children:[]},{value:"validateTopic",id:"validatetopic",children:[]}]}],s={toc:d};function c(e){var t=e.components,a=(0,r.Z)(e,p);return(0,i.kt)("wrapper",(0,n.Z)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"type-parameters"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"P")),(0,i.kt)("td",{parentName:"tr",align:"left"},"extends ",(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")),(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")))))),(0,i.kt)("h2",{id:"constructors"},"Constructors"),(0,i.kt)("h3",{id:"constructor"},"constructor"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"new Topic"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"P"),">","()"),(0,i.kt)("h4",{id:"type-parameters-1"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"P")),(0,i.kt)("td",{parentName:"tr",align:"left"},"extends ",(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")),(0,i.kt)("a",{parentName:"td",href:"../interfaces/Payload"},(0,i.kt)("inlineCode",{parentName:"a"},"Payload")))))),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L76"},"src/topic/index.ts:76")),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"options"},"options"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"options"),": ",(0,i.kt)("a",{parentName:"p",href:"../interfaces/TopicOptions"},(0,i.kt)("inlineCode",{parentName:"a"},"TopicOptions"))," = ",(0,i.kt)("inlineCode",{parentName:"p"},"defaultOptions")),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L73"},"src/topic/index.ts:73")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"project"},"project"),(0,i.kt)("p",null,"\u25aa ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"project"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"GooglePubSubProject")),(0,i.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L68"},"src/topic/index.ts:68")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"topicname"},"topicName"),(0,i.kt)("p",null,"\u25aa ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("inlineCode",{parentName:"p"},"Readonly")," ",(0,i.kt)("strong",{parentName:"p"},"topicName"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L67"},"src/topic/index.ts:67")),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"publish"},"publish"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"publish"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"options?"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"PayloadInput"),"<",(0,i.kt)("inlineCode",{parentName:"td"},"P"),">")),(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"options?")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"TopicPublishOptions"))))),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Promise"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"string"),">"),(0,i.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L127"},"src/topic/index.ts:127")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"validatemessage"},"validateMessage"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"validateMessage"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"This is run before publishing any messages, it is a no-op by default.\nCan overwrite to perform checks against payload before publishing"),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"PayloadInput"),"<",(0,i.kt)("inlineCode",{parentName:"td"},"P"),">"),(0,i.kt)("td",{parentName:"tr",align:"left"},"Message to be published")))),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L99"},"src/topic/index.ts:99")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"validatetopic"},"validateTopic"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("strong",{parentName:"p"},"validateTopic"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"name"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"This is run once when Topic is init to verify topic name"),(0,i.kt)("h4",{id:"parameters-2"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"name")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"string")),(0,i.kt)("td",{parentName:"tr",align:"left"},"topicName")))),(0,i.kt)("h4",{id:"returns-2"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/topic/index.ts#L88"},"src/topic/index.ts:88")))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/a8bbf00a.f5eed127.js b/assets/js/a8bbf00a.330c4b11.js similarity index 94% rename from assets/js/a8bbf00a.f5eed127.js rename to assets/js/a8bbf00a.330c4b11.js index 7062c573..e090d2b9 100644 --- a/assets/js/a8bbf00a.f5eed127.js +++ b/assets/js/a8bbf00a.330c4b11.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[8116],{3905:(e,t,a)=>{a.d(t,{Zo:()=>o,kt:()=>u});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=n.createContext({}),d=function(e){var t=n.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},o=function(e){var t=d(e.components);return n.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},k=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,o=s(e,["components","mdxType","originalType","parentName"]),k=d(a),u=r,c=k["".concat(p,".").concat(u)]||k[u]||m[u]||i;return a?n.createElement(c,l(l({ref:t},o),{},{components:a})):n.createElement(c,l({ref:t},o))}));function u(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,l=new Array(i);l[0]=k;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeof e?e:r,l[1]=s;for(var d=2;d{a.r(t),a.d(t,{default:()=>m,frontMatter:()=>s,metadata:()=>p,toc:()=>d});var n=a(7462),r=a(3366),i=(a(7294),a(3905)),l=["components"],s={id:"Message",title:"Class: Message",sidebar_label:"Message",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/classes/Message",id:"api/classes/Message",isDocsHomePage:!1,title:"Class: Message",description:"Type parameters",source:"@site/docs/api/classes/Message.md",sourceDirName:"api/classes",slug:"/api/classes/Message",permalink:"/hfc-pubsub/api/classes/Message",editUrl:null,version:"current",sidebar_label:"Message",sidebarPosition:0,frontMatter:{id:"Message",title:"Class: Message",sidebar_label:"Message",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"@honestfoodcompany/pubsub",permalink:"/hfc-pubsub/api/"},next:{title:"Class: PubSubService",permalink:"/hfc-pubsub/api/classes/PubSubService"}},d=[{value:"Type parameters",id:"type-parameters",children:[]},{value:"Constructors",id:"constructors",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties",children:[{value:"data",id:"data",children:[]},{value:"gCloudMessage",id:"gcloudmessage",children:[]}]},{value:"Methods",id:"methods",children:[{value:"ack",id:"ack",children:[]},{value:"decompress",id:"decompress",children:[]},{value:"modAck",id:"modack",children:[]},{value:"nack",id:"nack",children:[]},{value:"toJSON",id:"tojson",children:[]},{value:"from",id:"from",children:[]},{value:"fromGCloud",id:"fromgcloud",children:[]}]}],o={toc:d};function m(e){var t=e.components,a=(0,r.Z)(e,l);return(0,i.kt)("wrapper",(0,n.Z)({},o,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"type-parameters"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"T")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"unknown"))))),(0,i.kt)("h2",{id:"constructors"},"Constructors"),(0,i.kt)("h3",{id:"constructor"},"constructor"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"new Message"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"T"),">","()"),(0,i.kt)("h4",{id:"type-parameters-1"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"T")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"unknown"))))),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"data"},"data"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"data"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"Buffer")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L6"},"src/message/index.ts:6")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"gcloudmessage"},"gCloudMessage"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"gCloudMessage"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"Message")),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L7"},"src/message/index.ts:7")),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"ack"},"ack"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"ack"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L39"},"src/message/index.ts:39")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"decompress"},"decompress"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"decompress"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"Buffer")),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Buffer")),(0,i.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L57"},"src/message/index.ts:57")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"modack"},"modAck"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"modAck"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"deadline"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"deadline")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"number"))))),(0,i.kt)("h4",{id:"returns-2"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L45"},"src/message/index.ts:45")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"nack"},"nack"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"nack"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"returns-3"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L51"},"src/message/index.ts:51")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"tojson"},"toJSON"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"toJSON"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"T")),(0,i.kt)("h4",{id:"returns-4"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"T")),(0,i.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L31"},"src/message/index.ts:31")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"from"},"from"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("strong",{parentName:"p"},"from"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"M"),">","(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"M"),">"),(0,i.kt)("p",null,"Builds a new message object in the synchronous driver.\nUsed by the eventBus."),(0,i.kt)("h4",{id:"type-parameters-2"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"M"))))),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"M")),(0,i.kt)("td",{parentName:"tr",align:"left"},"any message that can be buffered")))),(0,i.kt)("h4",{id:"returns-5"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"M"),">"),(0,i.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L14"},"src/message/index.ts:14")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"fromgcloud"},"fromGCloud"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("strong",{parentName:"p"},"fromGCloud"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"unknown"),">"),(0,i.kt)("p",null,"Builds a message for Google Cloud Driver"),(0,i.kt)("h4",{id:"parameters-2"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"Message")),(0,i.kt)("td",{parentName:"tr",align:"left"},"A valid Google Cloud message")))),(0,i.kt)("h4",{id:"returns-6"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"unknown"),">"),(0,i.kt)("h4",{id:"defined-in-8"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/message/index.ts#L24"},"src/message/index.ts:24")))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[8116],{3905:(e,t,a)=>{a.d(t,{Zo:()=>o,kt:()=>u});var n=a(7294);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=n.createContext({}),d=function(e){var t=n.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},o=function(e){var t=d(e.components);return n.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},k=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,p=e.parentName,o=s(e,["components","mdxType","originalType","parentName"]),k=d(a),u=r,c=k["".concat(p,".").concat(u)]||k[u]||m[u]||i;return a?n.createElement(c,l(l({ref:t},o),{},{components:a})):n.createElement(c,l({ref:t},o))}));function u(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,l=new Array(i);l[0]=k;var s={};for(var p in t)hasOwnProperty.call(t,p)&&(s[p]=t[p]);s.originalType=e,s.mdxType="string"==typeof e?e:r,l[1]=s;for(var d=2;d{a.r(t),a.d(t,{default:()=>m,frontMatter:()=>s,metadata:()=>p,toc:()=>d});var n=a(7462),r=a(3366),i=(a(7294),a(3905)),l=["components"],s={id:"Message",title:"Class: Message",sidebar_label:"Message",sidebar_position:0,custom_edit_url:null},p={unversionedId:"api/classes/Message",id:"api/classes/Message",isDocsHomePage:!1,title:"Class: Message",description:"Type parameters",source:"@site/docs/api/classes/Message.md",sourceDirName:"api/classes",slug:"/api/classes/Message",permalink:"/hfc-pubsub/api/classes/Message",editUrl:null,version:"current",sidebar_label:"Message",sidebarPosition:0,frontMatter:{id:"Message",title:"Class: Message",sidebar_label:"Message",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"@honestfoodcompany/pubsub",permalink:"/hfc-pubsub/api/"},next:{title:"Class: PubSubService",permalink:"/hfc-pubsub/api/classes/PubSubService"}},d=[{value:"Type parameters",id:"type-parameters",children:[]},{value:"Constructors",id:"constructors",children:[{value:"constructor",id:"constructor",children:[]}]},{value:"Properties",id:"properties",children:[{value:"data",id:"data",children:[]},{value:"gCloudMessage",id:"gcloudmessage",children:[]}]},{value:"Methods",id:"methods",children:[{value:"ack",id:"ack",children:[]},{value:"decompress",id:"decompress",children:[]},{value:"modAck",id:"modack",children:[]},{value:"nack",id:"nack",children:[]},{value:"toJSON",id:"tojson",children:[]},{value:"from",id:"from",children:[]},{value:"fromGCloud",id:"fromgcloud",children:[]}]}],o={toc:d};function m(e){var t=e.components,a=(0,r.Z)(e,l);return(0,i.kt)("wrapper",(0,n.Z)({},o,a,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"type-parameters"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"T")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"unknown"))))),(0,i.kt)("h2",{id:"constructors"},"Constructors"),(0,i.kt)("h3",{id:"constructor"},"constructor"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"new Message"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"T"),">","()"),(0,i.kt)("h4",{id:"type-parameters-1"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"T")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"unknown"))))),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"data"},"data"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"data"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"Buffer")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L6"},"src/message/index.ts:6")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"gcloudmessage"},"gCloudMessage"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"gCloudMessage"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"Message")),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L7"},"src/message/index.ts:7")),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"ack"},"ack"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"ack"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L39"},"src/message/index.ts:39")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"decompress"},"decompress"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"decompress"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"Buffer")),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"Buffer")),(0,i.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L57"},"src/message/index.ts:57")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"modack"},"modAck"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"modAck"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"deadline"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"deadline")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"number"))))),(0,i.kt)("h4",{id:"returns-2"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L45"},"src/message/index.ts:45")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"nack"},"nack"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"nack"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"returns-3"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L51"},"src/message/index.ts:51")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"tojson"},"toJSON"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"toJSON"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"T")),(0,i.kt)("h4",{id:"returns-4"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"T")),(0,i.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L31"},"src/message/index.ts:31")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"from"},"from"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("strong",{parentName:"p"},"from"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"M"),">","(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"M"),">"),(0,i.kt)("p",null,"Builds a new message object in the synchronous driver.\nUsed by the eventBus."),(0,i.kt)("h4",{id:"type-parameters-2"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"M"))))),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"M")),(0,i.kt)("td",{parentName:"tr",align:"left"},"any message that can be buffered")))),(0,i.kt)("h4",{id:"returns-5"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"M"),">"),(0,i.kt)("h4",{id:"defined-in-7"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L14"},"src/message/index.ts:14")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"fromgcloud"},"fromGCloud"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Static")," ",(0,i.kt)("strong",{parentName:"p"},"fromGCloud"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"unknown"),">"),(0,i.kt)("p",null,"Builds a message for Google Cloud Driver"),(0,i.kt)("h4",{id:"parameters-2"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Description"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"Message")),(0,i.kt)("td",{parentName:"tr",align:"left"},"A valid Google Cloud message")))),(0,i.kt)("h4",{id:"returns-6"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"p"},"unknown"),">"),(0,i.kt)("h4",{id:"defined-in-8"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/message/index.ts#L24"},"src/message/index.ts:24")))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/bf56a78d.04f6a55e.js b/assets/js/bf56a78d.04f6a55e.js new file mode 100644 index 00000000..5df8a4bb --- /dev/null +++ b/assets/js/bf56a78d.04f6a55e.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[295],{3905:(e,t,r)=>{r.d(t,{Zo:()=>d,kt:()=>u});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),o=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},d=function(e){var t=o(e.components);return n.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,d=p(e,["components","mdxType","originalType","parentName"]),c=o(r),u=a,m=c["".concat(l,".").concat(u)]||c[u]||b[u]||i;return r?n.createElement(m,s(s({ref:t},d),{},{components:r})):n.createElement(m,s({ref:t},d))}));function u(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,s=new Array(i);s[0]=c;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:a,s[1]=p;for(var o=2;o{r.r(t),r.d(t,{default:()=>b,frontMatter:()=>p,metadata:()=>l,toc:()=>o});var n=r(7462),a=r(3366),i=(r(7294),r(3905)),s=["components"],p={id:"SubscriberObject",title:"Interface: SubscriberObject",sidebar_label:"SubscriberObject",sidebar_position:0,custom_edit_url:null},l={unversionedId:"api/interfaces/SubscriberObject",id:"api/interfaces/SubscriberObject",isDocsHomePage:!1,title:"Interface: SubscriberObject",description:"Type parameters",source:"@site/docs/api/interfaces/SubscriberObject.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/SubscriberObject",permalink:"/hfc-pubsub/api/interfaces/SubscriberObject",editUrl:null,version:"current",sidebar_label:"SubscriberObject",sidebarPosition:0,frontMatter:{id:"SubscriberObject",title:"Interface: SubscriberObject",sidebar_label:"SubscriberObject",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: SubscriberMetadata",permalink:"/hfc-pubsub/api/interfaces/SubscriberMetadata"},next:{title:"Interface: SubscriberOptions",permalink:"/hfc-pubsub/api/interfaces/SubscriberOptions"}},o=[{value:"Type parameters",id:"type-parameters",children:[]},{value:"Hierarchy",id:"hierarchy",children:[]},{value:"Properties",id:"properties",children:[{value:"description",id:"description",children:[]},{value:"options",id:"options",children:[]},{value:"subscriptionName",id:"subscriptionname",children:[]},{value:"topicName",id:"topicname",children:[]}]},{value:"Methods",id:"methods",children:[{value:"handleError",id:"handleerror",children:[]},{value:"handleMessage",id:"handlemessage",children:[]},{value:"init",id:"init",children:[]}]}],d={toc:o};function b(e){var t=e.components,r=(0,a.Z)(e,s);return(0,i.kt)("wrapper",(0,n.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"type-parameters"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"T")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"unknown"))))),(0,i.kt)("h2",{id:"hierarchy"},"Hierarchy"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"Omit"),"<",(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata"},(0,i.kt)("inlineCode",{parentName:"a"},"SubscriberMetadata")),", ",(0,i.kt)("inlineCode",{parentName:"p"},'"options"'),">")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"MessageHandler"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"T"),">")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"FlexibleObject")),(0,i.kt)("p",{parentName:"li"},"\u21b3 ",(0,i.kt)("strong",{parentName:"p"},(0,i.kt)("inlineCode",{parentName:"strong"},"SubscriberObject"))))),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"description"},"description"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"description"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"inherited-from"},"Inherited from"),(0,i.kt)("p",null,"Omit.description"),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L113"},"src/subscriber/subscriberV2.ts:113")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"options"},"options"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"options"),": ",(0,i.kt)("a",{parentName:"p",href:"SubscriberOptions"},(0,i.kt)("inlineCode",{parentName:"a"},"SubscriberOptions"))),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L142"},"src/subscriber/subscriberV2.ts:142")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"subscriptionname"},"subscriptionName"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"subscriptionName"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"inherited-from-1"},"Inherited from"),(0,i.kt)("p",null,"Omit.subscriptionName"),(0,i.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L111"},"src/subscriber/subscriberV2.ts:111")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"topicname"},"topicName"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"topicName"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"inherited-from-2"},"Inherited from"),(0,i.kt)("p",null,"Omit.topicName"),(0,i.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L110"},"src/subscriber/subscriberV2.ts:110")),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"handleerror"},"handleError"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"handleError"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"error"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"If passed, it would serve as the error handler method for internal google pubsub errors"),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"error")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"Error"))))),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"inherited-from-3"},"Inherited from"),(0,i.kt)("p",null,"MessageHandler.handleError"),(0,i.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L130"},"src/subscriber/subscriberV2.ts:130")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"handlemessage"},"handleMessage"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"handleMessage"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"will run every time a message is received"),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("a",{parentName:"td",href:"../classes/Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"td"},"T"),">")))),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"inherited-from-4"},"Inherited from"),(0,i.kt)("p",null,"MessageHandler.handleMessage"),(0,i.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L120"},"src/subscriber/subscriberV2.ts:120")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"init"},"init"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"init"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"will run before the message handler is attached to the subscription"),(0,i.kt)("h4",{id:"returns-2"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"inherited-from-5"},"Inherited from"),(0,i.kt)("p",null,"MessageHandler.init"),(0,i.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L125"},"src/subscriber/subscriberV2.ts:125")))}b.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/bf56a78d.33a88792.js b/assets/js/bf56a78d.33a88792.js deleted file mode 100644 index 047906d6..00000000 --- a/assets/js/bf56a78d.33a88792.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[295],{3905:(e,t,r)=>{r.d(t,{Zo:()=>b,kt:()=>u});var n=r(7294);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var l=n.createContext({}),o=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):s(s({},t),e)),r},b=function(e){var t=o(e.components);return n.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,b=p(e,["components","mdxType","originalType","parentName"]),c=o(r),u=a,m=c["".concat(l,".").concat(u)]||c[u]||d[u]||i;return r?n.createElement(m,s(s({ref:t},b),{},{components:r})):n.createElement(m,s({ref:t},b))}));function u(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=r.length,s=new Array(i);s[0]=c;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:a,s[1]=p;for(var o=2;o{r.r(t),r.d(t,{default:()=>d,frontMatter:()=>p,metadata:()=>l,toc:()=>o});var n=r(7462),a=r(3366),i=(r(7294),r(3905)),s=["components"],p={id:"SubscriberObject",title:"Interface: SubscriberObject",sidebar_label:"SubscriberObject",sidebar_position:0,custom_edit_url:null},l={unversionedId:"api/interfaces/SubscriberObject",id:"api/interfaces/SubscriberObject",isDocsHomePage:!1,title:"Interface: SubscriberObject",description:"Type parameters",source:"@site/docs/api/interfaces/SubscriberObject.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/SubscriberObject",permalink:"/hfc-pubsub/api/interfaces/SubscriberObject",editUrl:null,version:"current",sidebar_label:"SubscriberObject",sidebarPosition:0,frontMatter:{id:"SubscriberObject",title:"Interface: SubscriberObject",sidebar_label:"SubscriberObject",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: SubscriberMetadata",permalink:"/hfc-pubsub/api/interfaces/SubscriberMetadata"},next:{title:"Interface: SubscriberOptions",permalink:"/hfc-pubsub/api/interfaces/SubscriberOptions"}},o=[{value:"Type parameters",id:"type-parameters",children:[]},{value:"Hierarchy",id:"hierarchy",children:[]},{value:"Properties",id:"properties",children:[{value:"description",id:"description",children:[]},{value:"options",id:"options",children:[]},{value:"subscriptionName",id:"subscriptionname",children:[]},{value:"topicName",id:"topicname",children:[]}]},{value:"Methods",id:"methods",children:[{value:"handleError",id:"handleerror",children:[]},{value:"handleMessage",id:"handlemessage",children:[]},{value:"init",id:"init",children:[]}]}],b={toc:o};function d(e){var t=e.components,r=(0,a.Z)(e,s);return(0,i.kt)("wrapper",(0,n.Z)({},b,r,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"type-parameters"},"Type parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"T")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"unknown"))))),(0,i.kt)("h2",{id:"hierarchy"},"Hierarchy"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata"},(0,i.kt)("inlineCode",{parentName:"a"},"SubscriberMetadata")))),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"MessageHandler"),"<",(0,i.kt)("inlineCode",{parentName:"p"},"T"),">")),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("p",{parentName:"li"},(0,i.kt)("inlineCode",{parentName:"p"},"FlexibleObject")),(0,i.kt)("p",{parentName:"li"},"\u21b3 ",(0,i.kt)("strong",{parentName:"p"},(0,i.kt)("inlineCode",{parentName:"strong"},"SubscriberObject"))))),(0,i.kt)("h2",{id:"properties"},"Properties"),(0,i.kt)("h3",{id:"description"},"description"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"description"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"inherited-from"},"Inherited from"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata"},"SubscriberMetadata"),".",(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata#description"},"description")),(0,i.kt)("h4",{id:"defined-in"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L110"},"src/subscriber/subscriberV2.ts:110")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"options"},"options"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"options"),": ",(0,i.kt)("a",{parentName:"p",href:"SubscriberOptions"},(0,i.kt)("inlineCode",{parentName:"a"},"SubscriberOptions"))),(0,i.kt)("h4",{id:"inherited-from-1"},"Inherited from"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata"},"SubscriberMetadata"),".",(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata#options"},"options")),(0,i.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L111"},"src/subscriber/subscriberV2.ts:111")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"subscriptionname"},"subscriptionName"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"subscriptionName"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"inherited-from-2"},"Inherited from"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata"},"SubscriberMetadata"),".",(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata#subscriptionname"},"subscriptionName")),(0,i.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L109"},"src/subscriber/subscriberV2.ts:109")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"topicname"},"topicName"),(0,i.kt)("p",null,"\u2022 ",(0,i.kt)("strong",{parentName:"p"},"topicName"),": ",(0,i.kt)("inlineCode",{parentName:"p"},"string")),(0,i.kt)("h4",{id:"inherited-from-3"},"Inherited from"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata"},"SubscriberMetadata"),".",(0,i.kt)("a",{parentName:"p",href:"SubscriberMetadata#topicname"},"topicName")),(0,i.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L108"},"src/subscriber/subscriberV2.ts:108")),(0,i.kt)("h2",{id:"methods"},"Methods"),(0,i.kt)("h3",{id:"handleerror"},"handleError"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"handleError"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"error"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"If passed, it would serve as the error handler method for internal google pubsub errors"),(0,i.kt)("h4",{id:"parameters"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"error")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"Error"))))),(0,i.kt)("h4",{id:"returns"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"inherited-from-4"},"Inherited from"),(0,i.kt)("p",null,"MessageHandler.handleError"),(0,i.kt)("h4",{id:"defined-in-4"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L128"},"src/subscriber/subscriberV2.ts:128")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"handlemessage"},"handleMessage"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("strong",{parentName:"p"},"handleMessage"),"(",(0,i.kt)("inlineCode",{parentName:"p"},"message"),"): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"will run every time a message is received"),(0,i.kt)("h4",{id:"parameters-1"},"Parameters"),(0,i.kt)("table",null,(0,i.kt)("thead",{parentName:"table"},(0,i.kt)("tr",{parentName:"thead"},(0,i.kt)("th",{parentName:"tr",align:"left"},"Name"),(0,i.kt)("th",{parentName:"tr",align:"left"},"Type"))),(0,i.kt)("tbody",{parentName:"table"},(0,i.kt)("tr",{parentName:"tbody"},(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("inlineCode",{parentName:"td"},"message")),(0,i.kt)("td",{parentName:"tr",align:"left"},(0,i.kt)("a",{parentName:"td",href:"../classes/Message"},(0,i.kt)("inlineCode",{parentName:"a"},"Message")),"<",(0,i.kt)("inlineCode",{parentName:"td"},"T"),">")))),(0,i.kt)("h4",{id:"returns-1"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"inherited-from-5"},"Inherited from"),(0,i.kt)("p",null,"MessageHandler.handleMessage"),(0,i.kt)("h4",{id:"defined-in-5"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L118"},"src/subscriber/subscriberV2.ts:118")),(0,i.kt)("hr",null),(0,i.kt)("h3",{id:"init"},"init"),(0,i.kt)("p",null,"\u25b8 ",(0,i.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,i.kt)("strong",{parentName:"p"},"init"),"(): ",(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("p",null,"will run before the message handler is attached to the subscription"),(0,i.kt)("h4",{id:"returns-2"},"Returns"),(0,i.kt)("p",null,(0,i.kt)("inlineCode",{parentName:"p"},"void")),(0,i.kt)("h4",{id:"inherited-from-6"},"Inherited from"),(0,i.kt)("p",null,"MessageHandler.init"),(0,i.kt)("h4",{id:"defined-in-6"},"Defined in"),(0,i.kt)("p",null,(0,i.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L123"},"src/subscriber/subscriberV2.ts:123")))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f0debbde.5593c65f.js b/assets/js/f0debbde.5593c65f.js new file mode 100644 index 00000000..711ae259 --- /dev/null +++ b/assets/js/f0debbde.5593c65f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[6047],{3905:(e,r,t)=>{t.d(r,{Zo:()=>b,kt:()=>d});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=n.createContext({}),p=function(e){var r=n.useContext(o),t=r;return e&&(t="function"==typeof e?e(r):s(s({},r),e)),t},b=function(e){var r=p(e.components);return n.createElement(o.Provider,{value:r},e.children)},u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},l=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,a=e.originalType,o=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),l=p(t),d=i,f=l["".concat(o,".").concat(d)]||l[d]||u[d]||a;return t?n.createElement(f,s(s({ref:r},b),{},{components:t})):n.createElement(f,s({ref:r},b))}));function d(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var a=t.length,s=new Array(a);s[0]=l;var c={};for(var o in r)hasOwnProperty.call(r,o)&&(c[o]=r[o]);c.originalType=e,c.mdxType="string"==typeof e?e:i,s[1]=c;for(var p=2;p{t.r(r),t.d(r,{default:()=>u,frontMatter:()=>c,metadata:()=>o,toc:()=>p});var n=t(7462),i=t(3366),a=(t(7294),t(3905)),s=["components"],c={id:"SubscriberMetadata",title:"Interface: SubscriberMetadata",sidebar_label:"SubscriberMetadata",sidebar_position:0,custom_edit_url:null},o={unversionedId:"api/interfaces/SubscriberMetadata",id:"api/interfaces/SubscriberMetadata",isDocsHomePage:!1,title:"Interface: SubscriberMetadata",description:"Properties",source:"@site/docs/api/interfaces/SubscriberMetadata.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/SubscriberMetadata",permalink:"/hfc-pubsub/api/interfaces/SubscriberMetadata",editUrl:null,version:"current",sidebar_label:"SubscriberMetadata",sidebarPosition:0,frontMatter:{id:"SubscriberMetadata",title:"Interface: SubscriberMetadata",sidebar_label:"SubscriberMetadata",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: Payload",permalink:"/hfc-pubsub/api/interfaces/Payload"},next:{title:"Interface: SubscriberObject",permalink:"/hfc-pubsub/api/interfaces/SubscriberObject"}},p=[{value:"Properties",id:"properties",children:[{value:"description",id:"description",children:[]},{value:"options",id:"options",children:[]},{value:"subscriptionName",id:"subscriptionname",children:[]},{value:"topicName",id:"topicname",children:[]}]}],b={toc:p};function u(e){var r=e.components,t=(0,i.Z)(e,s);return(0,a.kt)("wrapper",(0,n.Z)({},b,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"description"},"description"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"description"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L113"},"src/subscriber/subscriberV2.ts:113")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"options"},"options"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("strong",{parentName:"p"},"options"),": ",(0,a.kt)("a",{parentName:"p",href:"SubscriberOptions"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriberOptions"))),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L112"},"src/subscriber/subscriberV2.ts:112")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"subscriptionname"},"subscriptionName"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("strong",{parentName:"p"},"subscriptionName"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L111"},"src/subscriber/subscriberV2.ts:111")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"topicname"},"topicName"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("strong",{parentName:"p"},"topicName"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/aa6ea15/src/subscriber/subscriberV2.ts#L110"},"src/subscriber/subscriberV2.ts:110")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f0debbde.d89388d9.js b/assets/js/f0debbde.d89388d9.js deleted file mode 100644 index eb8fc798..00000000 --- a/assets/js/f0debbde.d89388d9.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_honestfoodcompany_pubsub=self.webpackChunk_honestfoodcompany_pubsub||[]).push([[6047],{3905:(e,r,t)=>{t.d(r,{Zo:()=>b,kt:()=>d});var n=t(7294);function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=n.createContext({}),p=function(e){var r=n.useContext(o),t=r;return e&&(t="function"==typeof e?e(r):s(s({},r),e)),t},b=function(e){var r=p(e.components);return n.createElement(o.Provider,{value:r},e.children)},u={inlineCode:"code",wrapper:function(e){var r=e.children;return n.createElement(n.Fragment,{},r)}},l=n.forwardRef((function(e,r){var t=e.components,i=e.mdxType,a=e.originalType,o=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),l=p(t),d=i,f=l["".concat(o,".").concat(d)]||l[d]||u[d]||a;return t?n.createElement(f,s(s({ref:r},b),{},{components:t})):n.createElement(f,s({ref:r},b))}));function d(e,r){var t=arguments,i=r&&r.mdxType;if("string"==typeof e||i){var a=t.length,s=new Array(a);s[0]=l;var c={};for(var o in r)hasOwnProperty.call(r,o)&&(c[o]=r[o]);c.originalType=e,c.mdxType="string"==typeof e?e:i,s[1]=c;for(var p=2;p{t.r(r),t.d(r,{default:()=>u,frontMatter:()=>c,metadata:()=>o,toc:()=>p});var n=t(7462),i=t(3366),a=(t(7294),t(3905)),s=["components"],c={id:"SubscriberMetadata",title:"Interface: SubscriberMetadata",sidebar_label:"SubscriberMetadata",sidebar_position:0,custom_edit_url:null},o={unversionedId:"api/interfaces/SubscriberMetadata",id:"api/interfaces/SubscriberMetadata",isDocsHomePage:!1,title:"Interface: SubscriberMetadata",description:"Hierarchy",source:"@site/docs/api/interfaces/SubscriberMetadata.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/SubscriberMetadata",permalink:"/hfc-pubsub/api/interfaces/SubscriberMetadata",editUrl:null,version:"current",sidebar_label:"SubscriberMetadata",sidebarPosition:0,frontMatter:{id:"SubscriberMetadata",title:"Interface: SubscriberMetadata",sidebar_label:"SubscriberMetadata",sidebar_position:0,custom_edit_url:null},sidebar:"defaultSidebar",previous:{title:"Interface: Payload",permalink:"/hfc-pubsub/api/interfaces/Payload"},next:{title:"Interface: SubscriberObject",permalink:"/hfc-pubsub/api/interfaces/SubscriberObject"}},p=[{value:"Hierarchy",id:"hierarchy",children:[]},{value:"Properties",id:"properties",children:[{value:"description",id:"description",children:[]},{value:"options",id:"options",children:[]},{value:"subscriptionName",id:"subscriptionname",children:[]},{value:"topicName",id:"topicname",children:[]}]}],b={toc:p};function u(e){var r=e.components,t=(0,i.Z)(e,s);return(0,a.kt)("wrapper",(0,n.Z)({},b,t,{components:r,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"hierarchy"},"Hierarchy"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("p",{parentName:"li"},(0,a.kt)("strong",{parentName:"p"},(0,a.kt)("inlineCode",{parentName:"strong"},"SubscriberMetadata"))),(0,a.kt)("p",{parentName:"li"},"\u21b3 ",(0,a.kt)("a",{parentName:"p",href:"SubscriberObject"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriberObject"))))),(0,a.kt)("h2",{id:"properties"},"Properties"),(0,a.kt)("h3",{id:"description"},"description"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"description"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("h4",{id:"defined-in"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L110"},"src/subscriber/subscriberV2.ts:110")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"options"},"options"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("inlineCode",{parentName:"p"},"Optional")," ",(0,a.kt)("strong",{parentName:"p"},"options"),": ",(0,a.kt)("a",{parentName:"p",href:"SubscriberOptions"},(0,a.kt)("inlineCode",{parentName:"a"},"SubscriberOptions"))),(0,a.kt)("h4",{id:"defined-in-1"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L111"},"src/subscriber/subscriberV2.ts:111")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"subscriptionname"},"subscriptionName"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("strong",{parentName:"p"},"subscriptionName"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("h4",{id:"defined-in-2"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L109"},"src/subscriber/subscriberV2.ts:109")),(0,a.kt)("hr",null),(0,a.kt)("h3",{id:"topicname"},"topicName"),(0,a.kt)("p",null,"\u2022 ",(0,a.kt)("strong",{parentName:"p"},"topicName"),": ",(0,a.kt)("inlineCode",{parentName:"p"},"string")),(0,a.kt)("h4",{id:"defined-in-3"},"Defined in"),(0,a.kt)("p",null,(0,a.kt)("a",{parentName:"p",href:"https://github.com/deliveryhero/hfc-pubsub/blob/8e85602/src/subscriber/subscriberV2.ts#L108"},"src/subscriber/subscriberV2.ts:108")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.76eba56e.js b/assets/js/runtime~main.cd29fe83.js similarity index 92% rename from assets/js/runtime~main.76eba56e.js rename to assets/js/runtime~main.cd29fe83.js index 419f2ab9..8fd6678a 100644 --- a/assets/js/runtime~main.76eba56e.js +++ b/assets/js/runtime~main.cd29fe83.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,d,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,r.c=t,e=[],r.O=(a,c,d,f)=>{if(!c){var b=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,d,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",80:"9beb87c2",132:"ce7ebe9d",139:"157e1c0d",250:"cd8efe67",295:"bf56a78d",394:"e0a19902",588:"63864b9f",616:"946bd85a",644:"427b0a4e",695:"c5321162",759:"6c0d0759",835:"13caf63c",958:"ccccc4e2",1535:"5f9e1e26",1581:"6401c6ac",1615:"e0b73bec",1843:"68e633d4",1851:"0a95e4bf",2013:"0a17dca6",2053:"fcb40a64",2327:"7dbc7f38",2342:"fc4bded5",2674:"dc8c2cdd",2915:"431c6c56",2983:"ba8b3534",3102:"6794d4cd",3210:"689279c8",3527:"cde85646",3585:"c40b1558",3642:"eb18d9cc",3680:"1c01e663",4487:"43331796",4513:"919ef898",4917:"1ce1b65b",5127:"ede3a018",5141:"7c2352f0",5389:"0907d9f1",5641:"c10834c1",5814:"e38d0253",5880:"94c1d431",6047:"f0debbde",6121:"deb0c6b2",6144:"a346ea81",6194:"42e86e7d",6337:"e269132a",6671:"0dbda059",6705:"71b2aef0",6758:"01704409",6873:"ca6a4924",7063:"bbe72d6c",7086:"744d0d66",7104:"15ffd0c8",7197:"42c0a21a",7265:"14f4bfe4",7367:"24bb654f",7396:"da0304cc",7597:"5e8c322a",7918:"17896441",7941:"635b1727",8116:"a8bbf00a",8218:"7733b8cd",8390:"30a3e7fd",8520:"9893b3a0",8702:"411fc1af",8714:"269f7e80",9049:"da3d64a8",9114:"19371ada",9200:"a8f641c7",9279:"77234ab5",9285:"246f2c6f",9445:"afbd15c8",9514:"1be78505",9555:"79a01b9e",9627:"23abe487",9692:"6abb989d",9716:"87282cad",9812:"e2111aeb",9833:"4ac416b0",9919:"92d188cf"}[e]||e)+"."+{53:"7df665ee",80:"2570cf3d",132:"d6914687",139:"a8c504ea",250:"fc49f8bf",295:"33a88792",394:"ff21e398",588:"3006d79f",616:"8ca452b7",644:"2041dd24",695:"99ab9882",759:"09211c19",835:"dc040e5e",958:"adfd1802",1535:"c9875a14",1581:"3ff4cca2",1615:"cb953dca",1843:"0eb4782c",1851:"ec3ee2cb",2013:"0f01f555",2053:"10815e4e",2327:"a30ea0d9",2342:"40fa4a66",2674:"4232d9ba",2915:"dcd87dd0",2983:"52db900e",3102:"8ed5b6d6",3210:"f5458aa5",3527:"6fd9d8eb",3585:"fb1b404a",3642:"a2229138",3680:"47aa78b7",4487:"31d5f25b",4513:"8c446f23",4608:"017e0f24",4917:"dc0d6905",5127:"c350ff95",5141:"778c6833",5389:"ea64b670",5486:"2a341d20",5641:"ae236163",5814:"6dcde92f",5880:"3a251399",6047:"d89388d9",6121:"b9505f6d",6144:"cd2ccc14",6194:"5890ebcb",6337:"98e9956b",6671:"45eefaf1",6705:"09852079",6758:"96057a43",6873:"2a7de04b",7063:"36e94c3b",7086:"1c669602",7104:"69914504",7197:"d98d870d",7265:"8511ed7f",7367:"1cfb78d3",7396:"2e8a4fbc",7597:"6ea76047",7918:"47fdd088",7941:"bffc9816",8116:"f5eed127",8218:"a8af8903",8390:"3061e9aa",8520:"b67fb628",8702:"8df9f529",8714:"f7864469",9049:"140945c1",9114:"f7cdb297",9200:"e7d702ab",9279:"ef65da99",9285:"d8eef432",9445:"ddbb04ab",9512:"c76d7859",9514:"0c7dafeb",9555:"65bdee4e",9627:"8f597038",9692:"f17b46c4",9716:"1d30be2f",9812:"d7e36a41",9833:"d04ffc54",9919:"2c3882f6"}[e]+".js",r.miniCssF=e=>"assets/css/styles.831d01e3.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},f="@honestfoodcompany/pubsub:",r.l=(e,a,c,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(l);var f=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(c))),a)return a(c)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/hfc-pubsub/",r.gca=function(e){return e={17896441:"7918",43331796:"4487","935f2afb":"53","9beb87c2":"80",ce7ebe9d:"132","157e1c0d":"139",cd8efe67:"250",bf56a78d:"295",e0a19902:"394","63864b9f":"588","946bd85a":"616","427b0a4e":"644",c5321162:"695","6c0d0759":"759","13caf63c":"835",ccccc4e2:"958","5f9e1e26":"1535","6401c6ac":"1581",e0b73bec:"1615","68e633d4":"1843","0a95e4bf":"1851","0a17dca6":"2013",fcb40a64:"2053","7dbc7f38":"2327",fc4bded5:"2342",dc8c2cdd:"2674","431c6c56":"2915",ba8b3534:"2983","6794d4cd":"3102","689279c8":"3210",cde85646:"3527",c40b1558:"3585",eb18d9cc:"3642","1c01e663":"3680","919ef898":"4513","1ce1b65b":"4917",ede3a018:"5127","7c2352f0":"5141","0907d9f1":"5389",c10834c1:"5641",e38d0253:"5814","94c1d431":"5880",f0debbde:"6047",deb0c6b2:"6121",a346ea81:"6144","42e86e7d":"6194",e269132a:"6337","0dbda059":"6671","71b2aef0":"6705","01704409":"6758",ca6a4924:"6873",bbe72d6c:"7063","744d0d66":"7086","15ffd0c8":"7104","42c0a21a":"7197","14f4bfe4":"7265","24bb654f":"7367",da0304cc:"7396","5e8c322a":"7597","635b1727":"7941",a8bbf00a:"8116","7733b8cd":"8218","30a3e7fd":"8390","9893b3a0":"8520","411fc1af":"8702","269f7e80":"8714",da3d64a8:"9049","19371ada":"9114",a8f641c7:"9200","77234ab5":"9279","246f2c6f":"9285",afbd15c8:"9445","1be78505":"9514","79a01b9e":"9555","23abe487":"9627","6abb989d":"9692","87282cad":"9716",e2111aeb:"9812","4ac416b0":"9833","92d188cf":"9919"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var d=r.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>d=e[a]=[c,f]));c.push(d[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(c=>{if(r.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var f=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,d[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var d,f,[b,t,o]=c,n=0;if(b.some((a=>0!==e[a]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(a&&a(c);n{"use strict";var e,a,c,d,f,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,r.c=t,e=[],r.O=(a,c,d,f)=>{if(!c){var b=1/0;for(i=0;i=f)&&Object.keys(r.O).every((e=>r.O[e](c[o])))?c.splice(o--,1):(t=!1,f0&&e[i-1][2]>f;i--)e[i]=e[i-1];e[i]=[c,d,f]},r.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return r.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(e,d){if(1&d&&(e=this(e)),8&d)return e;if("object"==typeof e&&e){if(4&d&&e.__esModule)return e;if(16&d&&"function"==typeof e.then)return e}var f=Object.create(null);r.r(f);var b={};a=a||[null,c({}),c([]),c(c)];for(var t=2&d&&e;"object"==typeof t&&!~a.indexOf(t);t=c(t))Object.getOwnPropertyNames(t).forEach((a=>b[a]=()=>e[a]));return b.default=()=>e,r.d(f,b),f},r.d=(e,a)=>{for(var c in a)r.o(a,c)&&!r.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((a,c)=>(r.f[c](e,a),a)),[])),r.u=e=>"assets/js/"+({53:"935f2afb",80:"9beb87c2",132:"ce7ebe9d",139:"157e1c0d",250:"cd8efe67",295:"bf56a78d",394:"e0a19902",588:"63864b9f",616:"946bd85a",644:"427b0a4e",695:"c5321162",759:"6c0d0759",835:"13caf63c",958:"ccccc4e2",1535:"5f9e1e26",1581:"6401c6ac",1615:"e0b73bec",1843:"68e633d4",1851:"0a95e4bf",2013:"0a17dca6",2053:"fcb40a64",2327:"7dbc7f38",2342:"fc4bded5",2674:"dc8c2cdd",2915:"431c6c56",2983:"ba8b3534",3102:"6794d4cd",3210:"689279c8",3527:"cde85646",3585:"c40b1558",3642:"eb18d9cc",3680:"1c01e663",4487:"43331796",4513:"919ef898",4917:"1ce1b65b",5127:"ede3a018",5141:"7c2352f0",5389:"0907d9f1",5641:"c10834c1",5814:"e38d0253",5880:"94c1d431",6047:"f0debbde",6121:"deb0c6b2",6144:"a346ea81",6194:"42e86e7d",6337:"e269132a",6671:"0dbda059",6705:"71b2aef0",6758:"01704409",6873:"ca6a4924",7063:"bbe72d6c",7086:"744d0d66",7104:"15ffd0c8",7197:"42c0a21a",7265:"14f4bfe4",7367:"24bb654f",7396:"da0304cc",7597:"5e8c322a",7918:"17896441",7941:"635b1727",8116:"a8bbf00a",8218:"7733b8cd",8390:"30a3e7fd",8520:"9893b3a0",8702:"411fc1af",8714:"269f7e80",9049:"da3d64a8",9114:"19371ada",9200:"a8f641c7",9279:"77234ab5",9285:"246f2c6f",9445:"afbd15c8",9514:"1be78505",9555:"79a01b9e",9627:"23abe487",9692:"6abb989d",9716:"87282cad",9812:"e2111aeb",9833:"4ac416b0",9919:"92d188cf"}[e]||e)+"."+{53:"7df665ee",80:"2570cf3d",132:"d6914687",139:"df0a2536",250:"fc49f8bf",295:"04f6a55e",394:"ff21e398",588:"3006d79f",616:"8ca452b7",644:"2041dd24",695:"99ab9882",759:"09211c19",835:"6a54c260",958:"adfd1802",1535:"39d5b5a3",1581:"bf35ce5c",1615:"cb953dca",1843:"0eb4782c",1851:"ec3ee2cb",2013:"0f01f555",2053:"10815e4e",2327:"a30ea0d9",2342:"40fa4a66",2674:"4232d9ba",2915:"dcd87dd0",2983:"52db900e",3102:"8ed5b6d6",3210:"f5458aa5",3527:"6fd9d8eb",3585:"fb1b404a",3642:"a2229138",3680:"02b0d49e",4487:"31d5f25b",4513:"8c446f23",4608:"017e0f24",4917:"dc0d6905",5127:"c350ff95",5141:"778c6833",5389:"ea64b670",5486:"2a341d20",5641:"ae236163",5814:"6dcde92f",5880:"3a251399",6047:"5593c65f",6121:"b9505f6d",6144:"cd2ccc14",6194:"5890ebcb",6337:"98e9956b",6671:"45eefaf1",6705:"09852079",6758:"96057a43",6873:"2a7de04b",7063:"36e94c3b",7086:"1c669602",7104:"69914504",7197:"d98d870d",7265:"8511ed7f",7367:"e76d3000",7396:"2e8a4fbc",7597:"39808287",7918:"47fdd088",7941:"bffc9816",8116:"330c4b11",8218:"a8af8903",8390:"3061e9aa",8520:"b67fb628",8702:"8df9f529",8714:"f7864469",9049:"140945c1",9114:"f7cdb297",9200:"e7d702ab",9279:"ef65da99",9285:"d65c1318",9445:"ddbb04ab",9512:"c76d7859",9514:"0c7dafeb",9555:"65bdee4e",9627:"8f597038",9692:"f17b46c4",9716:"1d30be2f",9812:"d7e36a41",9833:"d04ffc54",9919:"2c3882f6"}[e]+".js",r.miniCssF=e=>"assets/css/styles.831d01e3.css",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),d={},f="@honestfoodcompany/pubsub:",r.l=(e,a,c,b)=>{if(d[e])d[e].push(a);else{var t,o;if(void 0!==c)for(var n=document.getElementsByTagName("script"),i=0;i{t.onerror=t.onload=null,clearTimeout(l);var f=d[e];if(delete d[e],t.parentNode&&t.parentNode.removeChild(t),f&&f.forEach((e=>e(c))),a)return a(c)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),o&&document.head.appendChild(t)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/hfc-pubsub/",r.gca=function(e){return e={17896441:"7918",43331796:"4487","935f2afb":"53","9beb87c2":"80",ce7ebe9d:"132","157e1c0d":"139",cd8efe67:"250",bf56a78d:"295",e0a19902:"394","63864b9f":"588","946bd85a":"616","427b0a4e":"644",c5321162:"695","6c0d0759":"759","13caf63c":"835",ccccc4e2:"958","5f9e1e26":"1535","6401c6ac":"1581",e0b73bec:"1615","68e633d4":"1843","0a95e4bf":"1851","0a17dca6":"2013",fcb40a64:"2053","7dbc7f38":"2327",fc4bded5:"2342",dc8c2cdd:"2674","431c6c56":"2915",ba8b3534:"2983","6794d4cd":"3102","689279c8":"3210",cde85646:"3527",c40b1558:"3585",eb18d9cc:"3642","1c01e663":"3680","919ef898":"4513","1ce1b65b":"4917",ede3a018:"5127","7c2352f0":"5141","0907d9f1":"5389",c10834c1:"5641",e38d0253:"5814","94c1d431":"5880",f0debbde:"6047",deb0c6b2:"6121",a346ea81:"6144","42e86e7d":"6194",e269132a:"6337","0dbda059":"6671","71b2aef0":"6705","01704409":"6758",ca6a4924:"6873",bbe72d6c:"7063","744d0d66":"7086","15ffd0c8":"7104","42c0a21a":"7197","14f4bfe4":"7265","24bb654f":"7367",da0304cc:"7396","5e8c322a":"7597","635b1727":"7941",a8bbf00a:"8116","7733b8cd":"8218","30a3e7fd":"8390","9893b3a0":"8520","411fc1af":"8702","269f7e80":"8714",da3d64a8:"9049","19371ada":"9114",a8f641c7:"9200","77234ab5":"9279","246f2c6f":"9285",afbd15c8:"9445","1be78505":"9514","79a01b9e":"9555","23abe487":"9627","6abb989d":"9692","87282cad":"9716",e2111aeb:"9812","4ac416b0":"9833","92d188cf":"9919"}[e]||e,r.p+r.u(e)},(()=>{var e={1303:0,532:0};r.f.j=(a,c)=>{var d=r.o(e,a)?e[a]:void 0;if(0!==d)if(d)c.push(d[2]);else if(/^(1303|532)$/.test(a))e[a]=0;else{var f=new Promise(((c,f)=>d=e[a]=[c,f]));c.push(d[2]=f);var b=r.p+r.u(a),t=new Error;r.l(b,(c=>{if(r.o(e,a)&&(0!==(d=e[a])&&(e[a]=void 0),d)){var f=c&&("load"===c.type?"missing":c.type),b=c&&c.target&&c.target.src;t.message="Loading chunk "+a+" failed.\n("+f+": "+b+")",t.name="ChunkLoadError",t.type=f,t.request=b,d[1](t)}}),"chunk-"+a,a)}},r.O.j=a=>0===e[a];var a=(a,c)=>{var d,f,[b,t,o]=c,n=0;if(b.some((a=>0!==e[a]))){for(d in t)r.o(t,d)&&(r.m[d]=t[d]);if(o)var i=o(r)}for(a&&a(c);n Changelog | Pub/Sub Node.js Framework - +

Version: v2

Changelog

2.2.2#

Patch Changes#

2.2.1#

Patch Changes#

2.2.0#

Minor Changes#

Patch Changes#

2.1.2#

Patch Changes#

2.1.1#

Patch Changes#

  • Prefer GOOGLE_CLOUD_LABELS over PUBSUB_LABELS env var (#90 by @rohit-gohri)

2.1.0#

Minor Changes#

2.0.1#

Patch Changes#

2.0.0#

Migration Guide

⚠️ Major Changes ⚠️#

Minor Changes#

  • PUB-73 - Add/improve helpers and TS usage(#79 by @ishan123456789)

    1. Allows to make _timestamp optional
    2. Removes double validation of topic names.
    3. Use publishJSON instead of buffering the payload.
    4. Adds .toJSON method to get parsed message/
    5. Remove getters (like getProjects, getName, getClient) and just use this.projects, this.name, etc directly.
  • PUB-69 - Changed init position for SubscriptionService.instance (#77 by @ishan123456789)

Patch Changes#

Full Changelog: v1.11.0...v2.0.0

1.11.0#

Minor Changes#

Patch Changes#

1.10.4#

Patch Changes#

1.10.3#

Patch Changes#

1.10.2#

Patch Changes#

1.10.1#

Patch Changes#

1.10.0#

Minor Changes#

Patch Changes#

1.9.0#

Minor Changes#

  • PUB-47 - Optimized DLQ configuration making PROJECT_NUMBER optional for assigning Publisher, Subscriber roles and allowing default subscription creation as a part of DLQ configuration (#43 by @ishan123456789)

1.8.1#

Patch Changes#

1.8.0#

Minor Changes#

Patch Changes#

1.7.12#

Patch Changes#

- + \ No newline at end of file diff --git a/getting-started/installation/index.html b/getting-started/installation/index.html index 4c9678c0..d51edb13 100644 --- a/getting-started/installation/index.html +++ b/getting-started/installation/index.html @@ -6,13 +6,13 @@ Installation | Pub/Sub Node.js Framework - +
Version: v2

Installation

Requirements#

  • Node.js version >= 12.22.0 or above (which can be checked by running node -v). You can use nvm for managing multiple Node versions on a single machine installed

Install#

From NPM#

npm

npm i --save @honestfoodcompany/pubsub

Or

yarn add @honestfoodcompany/pubsub

From Github Package Repository#

We also publish to Github Package Repository as @deliveryhero/pubsub. To install from there, first add this to your .npmrc:

@deliveryhero:registry="https://npm.pkg.github.com/"

Or for .yarnrc:

npmScopes:
deliveryhero:
npmRegistryServer: 'https://npm.pkg.github.com/'

And then install the package.

npm i --save @deliveryhero/pubsub

OR

yarn add @deliveryhero/pubsub

Project structure#

The framework expects that you've created a pubsub directory in your project with the following structure:

├── .env <-- this should be in your project root directory and will be auto-loaded
├── pubsub/ <-- this can be anywhere and named anything (defined in .env as PUBSUB_ROOT_DIR)
│ ├── subscriptions/ <-- any files ending with a `.sub.js` ext will be auto-loaded from here
│ ├── topics/
│ └── subscription.service.js <-- this is the entrypoint for the service
└── package.json

Environment Variables/CLI Args#

The framework expects the following environment variables. They can be added to the .env file or passed through CLI args.

CLI ArgumentEnv VariableDescription
root-dirPUBSUB_ROOT_DIRmust be the path to your project's pubsub directory.
google-application-credentialsGOOGLE_APPLICATION_CREDENTIALSsee https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account to generate this
project-idGOOGLE_CLOUD_PROJECTthe project-id in Google Cloud Platform
labelsGOOGLE_CLOUD_LABELSLabels in stringified JSON format
server-portPUBSUB_SERVER_PORTPORT at which the pubsub should run the server at
health-serverPUBSUB_HEALTH_SERVERIf value assigned is true this would run a server showing health state and return 500 if not healthy

Read more in CLI docs

What next?#

  1. Once the directory structure has been defined and environment variables set
  2. Then you can create subscriptions and topics
  3. Initialize your database connection, define project-level subscription defaults, and register subscriptions in the Subscription Service.
  4. After a service has been created, use the CLI to start the subscriptions server.
- + \ No newline at end of file diff --git a/guides/cli/index.html b/guides/cli/index.html index 60ee23d1..cd5a3e06 100644 --- a/guides/cli/index.html +++ b/guides/cli/index.html @@ -6,7 +6,7 @@ CLI | Pub/Sub Node.js Framework - + @@ -15,7 +15,7 @@
Google Pub/Sub Subscriptions
Topic name Subscription name Description
simple.topic simple.topic.console-log.subscription-with-options Will console log messages published on test.topic
test.topic test.topic.console-log Will console log messages published on test.topic
test.topic test.topic.console-log.v2 Will console log messages published on test.topic

Subscriptions Start#

This will start a subscription service using the subscription.service.{js/ts} file in your PUBSUB_ROOT_DIR. It will first call the init method of the Service class and then start the subscriptions, allowing you to do any startup tasks. Read more about service here

$ npx subscriptions start
Starting Google Pub/Sub Subscriptions Server
[2021-08-27 10:16:26.824 +0530] INFO: ***** INIT CALLED *****
[2021-08-27 10:16:26.824 +0530] INFO: Connecting to DB
[2021-08-27 10:16:27.829 +0530] INFO: Connected to DB
[2021-08-27 10:16:27.830 +0530] INFO: ***** INIT CALLED *****
[2021-08-27 10:16:29.515 +0530] INFO: ✔️ simple.topic.console-log.subscription-with-options already exists.
[2021-08-27 10:16:43.766 +0530] INFO: 📭 simple.topic.console-log.subscription-with-options is ready to receive messages at a controlled volume of 100 messages.
[2021-08-27 10:16:44.887 +0530] INFO: ✔️ test.topic.console-log already exists.
[2021-08-27 10:16:49.395 +0530] INFO: 📭 test.topic.console-log is ready to receive messages at a controlled volume of 5 messages.
[2021-08-27 10:16:51.349 +0530] INFO: ✔️ test.topic.console-log.v2 already exists.
[2021-08-27 10:17:03.902 +0530] INFO: 📭 test.topic.console-log.v2 is ready to receive messages at a controlled volume of 5 messages.
[2021-08-27 10:17:03.902 +0530] INFO: ✅ All subscriptions started successfully.

Development Environment#

For local use you may want to call the CLI with ts-node instead of directly if you are using typescript.

Usage with Typescript#

For use with Typescript, update your local PUBSUB_ROOT_DIR env var to the src directory of the project with the typescript files.

And instead of using npx subscriptions start you can invoke the bin script with ts-node:

npx ts-node ./node_modules/.bin/subscriptions start

If you have a separate tsconfig for your server code then you should pass it to ts-node:

npx ts-node --project tsconfig.server.json ./node_modules/.bin/subscriptions start

To make this easier you can add a script in your package.json:

{
"scripts": {
"pubsub": "ts-node ./node_modules/.bin/subscriptions start"
}
}

Use Debugger with Typescript#

ts-node doesn't have an --inspect option unlike the node cli. But we can still pass it to the node process by way of the NODE_OPTIONS env var.

NODE_OPTIONS='--inspect' ts-node --project tsconfig.server.json ./node_modules/.bin/subscriptions start

Watch Mode with Typescript#

You can use nodemon in combination with ts-node to develop in watch mode:

{
"scripts": {
"pubsub": "nodemon --exec \"NODE_OPTIONS='--inspect' ts-node --project tsconfig.server.json ./node_modules/.bin/subscriptions start\""
}
}
- + \ No newline at end of file diff --git a/guides/drivers/index.html b/guides/drivers/index.html index 831504e0..38d4c2c8 100644 --- a/guides/drivers/index.html +++ b/guides/drivers/index.html @@ -6,13 +6,13 @@ PubSub Drivers | Pub/Sub Node.js Framework - +
Version: v2

PubSub Drivers

Google PubSub Driver#

This is the default driver. It uses Google Cloud PubSub to send messages.

The GCP project-id can be set via the env var and GOOGLE_CLOUD_PROJECT and service account via GOOGLE_APPLICATION_CREDENTIALS to function correctly. If not provided then the sdk will automatically try to get the values from home directory/service account.

The role assigned to the service account in the credentials should be roles/pubsub.admin

note

NOTE: Make sure the service account is assigned the correct roles

This is required because we require the below permissions:

PermissionReason
pubsub.topics.publishPublish to Topic
pubsub.subscriptions.consumeConsume from Subscription
pubsub.topics.getGet Topic to create subscription for it
pubsub.topics.attachSubscriptionCreate subscription for a topic
pubsub.subscriptions.getGet subscription to start consuming it
pubsub.topics.createCreating Topics Automatically (for publishing, subscribing and DLQs)
pubsub.subscriptions.createCreating Subscriptions (for subscribing and DLQs)
resourcemanager.projects.getGet Project Number from Project to bind DLQ policies
pubsub.subscriptions.setIamPolicyAssigning Subscriber Role for DLQs
pubsub.topics.setIamPolicyAssigning Publisher Role for DLQs

Synchronous Driver#

If you would like to bypass Google PubSub and run your subscriptions synchronously (for development purposes) set the following environment variable:

PUBSUB_DRIVER=synchronous

This uses an EventEmitter based pubsub model, and hence only works inside a single process.

caution

NOTE: Not recommended for production use

This is useful for writing unit tests, read more in the testing guide

Features not supported in Synchronous Driver#

  • Filtering using attributes
  • Retrying failed messages
- + \ No newline at end of file diff --git a/guides/migrating-to-v2/index.html b/guides/migrating-to-v2/index.html index 07745668..12dfb230 100644 --- a/guides/migrating-to-v2/index.html +++ b/guides/migrating-to-v2/index.html @@ -6,7 +6,7 @@ Migrating to v2 | Pub/Sub Node.js Framework - + @@ -29,7 +29,7 @@
export default: SubscriberObject<Payload> = {
topicName: 'simple.topic',
subscriptionName: 'simple.topic.console-log.sub',
description: 'Will console log messages published on test.topic',
handleMessage: function(message): void {
console.log(this.subscriptionName, 'received message');
// This is already typed as Payload
const payload = message.toJson();
console.log(payload.data);
message.ack();
},
handleError: function(error: Error): void {
console.error(error);
process.exit(1);
}
};
- + \ No newline at end of file diff --git a/guides/testing/index.html b/guides/testing/index.html index d9961f64..8c0082f3 100644 --- a/guides/testing/index.html +++ b/guides/testing/index.html @@ -6,13 +6,13 @@ Testing | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/index.html b/index.html index 6b255a56..817899ad 100644 --- a/index.html +++ b/index.html @@ -6,13 +6,13 @@ Introduction | Pub/Sub Node.js Framework - +
Version: v2

Introduction

@honestfoodcompany/pubsub#

PubSub is a lightweight framework and subscription server for Google Pub/Sub. It was created to speed up development time ⚡️ and it provides a common foundation for building event driven applications. It lets developers define topics and subscriptions simply and declaratively, while additionally offering a simple subscription server to run all of a project's subscription handlers.

demo of subscription service starting through cli

Features#

PubSub Framework is built with the developer experience in mind.

  • Built with 💚 and Typescript

    • In built types
    • Run with ts-node in dev
  • Easy to setup

    • Define pub/sub subscriptions and topics in a declarative way
    • Define your subscription handlers with a simple object
    • Define a topic and publish messages with a few lines of code
  • ✂️ Developer experience

    • Start receiving messages in minutes
    • Add configuration defaults for all your subscriptions in one place
    • DLQs and IAM automatically handled for you
    • Auto load code from folder
- + \ No newline at end of file diff --git a/options/index.html b/options/index.html index f9655c15..ca36d25c 100644 --- a/options/index.html +++ b/options/index.html @@ -6,13 +6,13 @@ Other Options | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/publishing/attributes/index.html b/publishing/attributes/index.html index 9214613d..5fd99771 100644 --- a/publishing/attributes/index.html +++ b/publishing/attributes/index.html @@ -6,7 +6,7 @@ Publishing with Attributes | Pub/Sub Node.js Framework - + @@ -14,7 +14,7 @@ - + \ No newline at end of file diff --git a/publishing/publish-diff-project/index.html b/publishing/publish-diff-project/index.html index df5535ab..80eec71c 100644 --- a/publishing/publish-diff-project/index.html +++ b/publishing/publish-diff-project/index.html @@ -6,13 +6,13 @@ Publishing on a Different GCP project | Pub/Sub Node.js Framework - +
Version: v2

Publishing on a Different GCP project

/pubsub/topics/example-topic-with-custom-credentials.ts
export default class ExampleTopic extends Topic {
static readonly topicName = 'example-topic-with-custom-credentials';
static project: GooglePubSubProject = {
id: 'custom-project-id',
credentials: {
// eslint-disable-next-line
client_email: 'client@google-auth.google.com',
// eslint-disable-next-line
private_key: 'private_key_goes_here'
},
};
}
- + \ No newline at end of file diff --git a/publishing/retry-settings/index.html b/publishing/retry-settings/index.html index 605c653c..3f549f73 100644 --- a/publishing/retry-settings/index.html +++ b/publishing/retry-settings/index.html @@ -6,14 +6,14 @@ Publishing a message with retry settings | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/publishing/topics/index.html b/publishing/topics/index.html index d8c2dedc..25b61054 100644 --- a/publishing/topics/index.html +++ b/publishing/topics/index.html @@ -6,7 +6,7 @@ Topics | Pub/Sub Node.js Framework - + @@ -15,7 +15,7 @@
export interface Payload extends BasePayload {
id: number;
data: string;
}
export default class SimpleTopic extends Topic<Payload> {
static readonly topicName = 'simple.topic.name';
}
tip

As a convention, the name of the topic file should match the name of the topic name so the file directory becomes self-documenting.

Publishing a message#

If a topic does not exist, it will be created before a message is published.

Example#

client.example.ts
import SimpleTopic from 'PUBSUB_ROOT_DIR/topics/simple.topic.name';
new SimpleTopic().publish({ id: 1, data: 'My first message' });

Compression#

Framework supports gzip compression on publish. It can be enabled in Topic options.

With option enabled, message data will compressed before publish to PubSub.

See Compression Topic example, Messages decompression.

- + \ No newline at end of file diff --git a/server/connect-database/index.html b/server/connect-database/index.html index 18bb7eac..61dc159c 100644 --- a/server/connect-database/index.html +++ b/server/connect-database/index.html @@ -6,7 +6,7 @@ Connecting to a Database | Pub/Sub Node.js Framework - + @@ -15,7 +15,7 @@
export default class SubscriptionService extends PubSub.SubscriptionService {
/**
* This function is called when the subscription server starts.
*/
static async init(): Promise<void> {
/**
* This is a good place to initialize a database connection
*/
await mongoose.connect();
}
}
- + \ No newline at end of file diff --git a/server/custom-logger/index.html b/server/custom-logger/index.html index 6e6e0b3e..90f52aa5 100644 --- a/server/custom-logger/index.html +++ b/server/custom-logger/index.html @@ -6,14 +6,14 @@ Passing a Custom Logger | Pub/Sub Node.js Framework - +
Version: v2

Passing a Custom Logger

In the main SubscriptionService before defining subscription class you can update the logger that is being used by the package for logging. It's an optional definition and by default it uses console.* for logging .info, .warn and .error these 3 function keys are a must have for the logger you pass.

/pubsub/subscription.service.ts
import * as PubSub from '@honestfoodcompany/pubsub';
/**
* This function call is optional, you can pass an instance of Pino, Winston logger
* By default it uses default console.* for logging
* The logger you pass must support .error, .info and .warn methods for it to work
*/
PubSub.setLogger(console);

You can also call setLogger from some other file like a global file, just make sure it gets imported somehow into the subscription.service.

const { setLogger } = require('@honestfoodcompany/pubsub');
setLogger(console);
- + \ No newline at end of file diff --git a/server/graceful-shutdown/index.html b/server/graceful-shutdown/index.html index bccc2265..46525f9a 100644 --- a/server/graceful-shutdown/index.html +++ b/server/graceful-shutdown/index.html @@ -6,7 +6,7 @@ Graceful Shutdown | Pub/Sub Node.js Framework - + @@ -14,7 +14,7 @@
Version: v2

Graceful Shutdown

When gracefully shutting down a process, it is a good idea to first close all open subscriptions and DB connections. For this reason we have a static closeAll method in the SubscriptionService that can close all connections before shutting down. An example using it with process signal handlers:

/pubsub/subscription.service.ts
import * as PubSub from '@honestfoodcompany/pubsub';
import mongoose from 'mongoose';
import { SubscriberOptions } from '@honestfoodcompany/pubsub';
export default class SubscriptionService extends PubSub.SubscriptionService {
/**
* This function is called when the subscription server starts.
*/
static async init(): Promise<void> {
/**
* This is a good place to initialize a database connection
*/
await mongoose.connect();
}
}
/**
* Example setting up graceful shutdown
*/
process.on('SIGTERM', () => {
// First close all subscriptions
SubscriptionService.closeAll()
.then(() => {
// Then the databse so no new handlers are triggered
return mongoose.disconnect()
.then(() => {
// Then exit the process
process.exit(0);
});
})
.catch((err) => {
console.error(err, 'Could not close subscriptions');
process.exit(1); // Exit with error
});
});
- + \ No newline at end of file diff --git a/server/health-check/index.html b/server/health-check/index.html index d58dff8d..8715cc5a 100644 --- a/server/health-check/index.html +++ b/server/health-check/index.html @@ -6,13 +6,13 @@ Health Checks | Pub/Sub Node.js Framework - +
Version: v2

Health Checks

For health checks and readiness probes you can enable the inbuilt health check http server by setting the following environment variables (or corresponding CLI option) :

PUBSUB_HEALTH_SERVER=true
PUBSUB_SERVER_PORT=8080

This will expose a very simple http server that checks the static method isHealthy and returns status code accordingly.

You can also define your own server in your app and use the public static method directly as part of your custom health check endpoint.

- + \ No newline at end of file diff --git a/server/service/index.html b/server/service/index.html index 97468565..60dad357 100644 --- a/server/service/index.html +++ b/server/service/index.html @@ -6,7 +6,7 @@ Subscription Service | Pub/Sub Node.js Framework - + @@ -20,7 +20,7 @@
SubscriptionService.defaultSubscriberOptions = {
/**
* Define project-level default subscriber options here.
* These options can be overridden by options defined in subscribers
*/
};
SubscriptionService.init = () => {
/**
* This function is called when the subscription server starts.
* This is a good place to initialize a database connection
*/
};
exports.default = SubscriptionService;

Running the Service#

To run the service you can use the CLI commands:

npx subscriptions start
- + \ No newline at end of file diff --git a/subscribing/Messages_compression/index.html b/subscribing/Messages_compression/index.html index b7f5b839..eaf9f5fe 100644 --- a/subscribing/Messages_compression/index.html +++ b/subscribing/Messages_compression/index.html @@ -6,7 +6,7 @@ Messages compression | Pub/Sub Node.js Framework - + @@ -16,7 +16,7 @@
const subscriber: SubscriberObject<Payload> = {
topicName: 'compression.topic',
subscriptionName: 'compression.topic.console-log.subscription',
handleMessage: (message) => {
console.log('is compressed', isGzipCompressed(message.data)); // true if payload is compressed
console.log(message.toJSON()); // automatically decompress payload if it's compressed
message.ack();
},
};
export default subscriber;
- + \ No newline at end of file diff --git a/subscribing/dead-letter-policy/index.html b/subscribing/dead-letter-policy/index.html index fbaa8bcc..028d1eaa 100644 --- a/subscribing/dead-letter-policy/index.html +++ b/subscribing/dead-letter-policy/index.html @@ -6,13 +6,13 @@ Subscriptions with a Dead-letter Policy | Pub/Sub Node.js Framework - +
Version: v2

Subscriptions with a Dead-letter Policy

It is possible to define a dead-letter policy for a subscription. If the dead letter topic does not exist, it will be created automatically by the framework.

"/pubsub/subscriptions/simple.topic.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
options: {
deadLetterPolicy: {
deadLetterTopic: 'test.topic.sub.dlq',
maxDeliveryAttempts: 15,
createDefaultSubscription: true,
},
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
},
};

Binding Subscriber and Publisher role#

The framework will automatically attach a Publisher & Subscriber role to your dead letter queue, just add a DLQ config and make sure your service account has the roles defined here.

tip

Binding the above policies don't require current subscriptions to be deleted and recreated.

This is following the best practices defined by Google here

Checking for subscribers to DLQ topic#

A dead letter topic is not useful without a subscription for it, because without it all messages are just lost to the void.

To avoid this scenario, we automatically check for subscriptions on the DLQ topic and warn in case the DLQ topic doesn't have any subscriptions. Example warning:

Please set createDefaultSubscription: true in deadLetterPolicy to create default subscriber for dead letter topic of simple.topic.console-log.subscription-with-options. Ignore if already added subscription for it.

Automatically creating default subscribers#

To make it easy to set this up, we have a option createDefaultSubscription that will automatically create a default dead letter subscription with name having .default added to the deadLetterTopic.

For example, if deadLetterTopic is example.test.dlq then a subscription called example.test.dlq.default will be automatically created if createDefaultSubscription is true.

- + \ No newline at end of file diff --git a/subscribing/error-handling/index.html b/subscribing/error-handling/index.html index a41bea7a..06b4c2b4 100644 --- a/subscribing/error-handling/index.html +++ b/subscribing/error-handling/index.html @@ -6,7 +6,7 @@ Internal Error Handling | Pub/Sub Node.js Framework - + @@ -27,7 +27,7 @@
SubscriptionService.init = () => {};
SubscriptionService.handleError = (error, metadata) => {
// global default error handling logic for all subscribers
console.error({err, metadata}, 'Default error handler');
// Close DB connections/etc here
process.exit(1);
};
exports.default = SubscriptionService;
- + \ No newline at end of file diff --git a/subscribing/labels/index.html b/subscribing/labels/index.html index 3569a279..de5d3b39 100644 --- a/subscribing/labels/index.html +++ b/subscribing/labels/index.html @@ -6,7 +6,7 @@ Adding Labels | Pub/Sub Node.js Framework - + @@ -14,7 +14,7 @@
Version: v2

Adding Labels

Global Labels#

Subscription Service can have global labels in defaultSubscriberOptions, these will be merged with local subscriber level labels.

Env Var#

We also support GOOGLE_CLOUD_LABELS env var which can be a stringified JSON. These work as the default labels added to each subscription. Example:

# .env file
GOOGLE_CLOUD_LABELS='{"service": "hfc-pubsub", "env": "prod"}'

Subscriber Specific Labels#

Each subscriber can also add it's own labels, these overwrite the above mentioned Global Labels.

const TestSubscription: SubscriberObject<Payload> = {
topicName: 'test-topic',
subscriptionName: 'test-topic.example.subscription',
description: 'Just a test subscription',
options: {
labels: {
tribe: 'GFS',
service: 'pubsub',
},
},
async handleMessage(message): Promise<void> {
const payload = message.toJSON();
console.log(payload);
message.ack();
},
};
- + \ No newline at end of file diff --git a/subscribing/message-ordering/index.html b/subscribing/message-ordering/index.html index 201bbb82..f8b56b98 100644 --- a/subscribing/message-ordering/index.html +++ b/subscribing/message-ordering/index.html @@ -6,13 +6,13 @@ Subscription with Message Ordering | Pub/Sub Node.js Framework - +
Version: v2

Subscription with Message Ordering

Messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.

"/pubsub/subscriptions/simple.topic.name.subscription.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
options: {
enableMessageOrdering: true,
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
},
};
- + \ No newline at end of file diff --git a/subscribing/retry-policy/index.html b/subscribing/retry-policy/index.html index 687a9d15..8bc57ecb 100644 --- a/subscribing/retry-policy/index.html +++ b/subscribing/retry-policy/index.html @@ -6,13 +6,13 @@ Subscriptions with Retry Policy | Pub/Sub Node.js Framework - +
Version: v2

Subscriptions with Retry Policy

It is possible to define a retry configuration for a subscription:

/pubsub/subscriptions/simple.topic.name.subscription.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
options: {
retryPolicy: {
minimumBackoff: { seconds: 20, nanos: 20 },
maximumBackoff: { seconds: 400, nanos: 2 },
},
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
},
};
- + \ No newline at end of file diff --git a/subscribing/subscriptions/index.html b/subscribing/subscriptions/index.html index df2b0283..0f290786 100644 --- a/subscribing/subscriptions/index.html +++ b/subscribing/subscriptions/index.html @@ -6,7 +6,7 @@ Subscriptions | Pub/Sub Node.js Framework - + @@ -17,7 +17,7 @@
handleError: function(error: Error): void {
// default error handler for subscriber
}
};

Javascript subscription example#

/pubsub/subscriptions/simple.topic.name.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
handleMessage: function (message) {
console.log(this.subscriptionName, 'received message');
console.log(message.data.toString());
message.ack();
},
};

Subscription example with custom subscriber options#

"/pubsub/subscriptions/simple.topic.name.subscription.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.subscription',
description: 'Will console log messages published on test.topic',
options: {
flowControl: {
maxMessages: 500, // max messages in progress
},
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
message.ack();
},
};

Subscriber Options#

See full options available in API Docs.

- + \ No newline at end of file diff --git a/v1/api/classes/Message/index.html b/v1/api/classes/Message/index.html index 2acb5ebf..5097cad4 100644 --- a/v1/api/classes/Message/index.html +++ b/v1/api/classes/Message/index.html @@ -6,14 +6,14 @@ Class: Message | Pub/Sub Node.js Framework - +
Version: v1

Class: Message

Constructors#

constructor#

new Message()

Properties#

data#

data: Buffer

Defined in#

src/message/index.ts:4


gCloudMessage#

Optional gCloudMessage: Message

Defined in#

src/message/index.ts:5

Methods#

ack#

ack(): void

Returns#

void

Defined in#

src/message/index.ts:29


modAck#

modAck(deadline): void

Parameters#

NameType
deadlinenumber

Returns#

void

Defined in#

src/message/index.ts:35


nack#

nack(): void

Returns#

void

Defined in#

src/message/index.ts:41


from#

Static from(message): Message

Builds a new message object in the synchronous driver. Used by the eventBus.

Parameters#

NameTypeDescription
messageanyany message that can be buffered

Returns#

Message

Defined in#

src/message/index.ts:12


fromGCloud#

Static fromGCloud(message): Message

Builds a message for Google Cloud Driver

Parameters#

NameTypeDescription
messageMessageA valid Google Cloud message

Returns#

Message

Defined in#

src/message/index.ts:22

- + \ No newline at end of file diff --git a/v1/api/classes/PubSubService/index.html b/v1/api/classes/PubSubService/index.html index 5af26138..2fbce177 100644 --- a/v1/api/classes/PubSubService/index.html +++ b/v1/api/classes/PubSubService/index.html @@ -6,13 +6,13 @@ Class: PubSubService | Pub/Sub Node.js Framework - +
Version: v1

Class: PubSubService

Constructors#

constructor#

Private new PubSubService()

Defined in#

src/service/pubsub.ts:18

Properties#

server#

Private Optional server: Server

Defined in#

src/service/pubsub.ts:16


client#

Static Protected client: PubSubClientV2

Defined in#

src/service/pubsub.ts:12


driver#

Static Protected driver: "synchronous" | "google"

Defined in#

src/service/pubsub.ts:14


instance#

Static Protected instance: PubSubService

Defined in#

src/service/pubsub.ts:13


status#

Static Private status: "ready" | "pending" | "closed" = 'pending'

Defined in#

src/service/pubsub.ts:15

Methods#

bind#

Private bind(instance): void

Parameters#

NameType
instancePubSubService

Returns#

void

Defined in#

src/service/pubsub.ts:72


closeAll#

closeAll(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:133


getAllSubscriptions#

getAllSubscriptions(): Promise<AllSubscriptions[]>

Retrieves a list of subscribers

Returns#

Promise<AllSubscriptions[]>

Defined in#

src/service/pubsub.ts:219


getClient#

Private getClient(): PubSubClientV2

Returns#

PubSubClientV2

Defined in#

src/service/pubsub.ts:125


getSubscribers#

getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/pubsub.ts:129


initClient#

initClient(): void

Returns#

void

Defined in#

src/service/pubsub.ts:89


initDriver#

Private initDriver(): void

Returns#

void

Defined in#

src/service/pubsub.ts:77


publish#

publish<T, P>(topic, message, options): Promise<string>

Publishes new orders to PubSub.

Type parameters#

NameType
Textends Topic<T>
Pextends Payload

Parameters#

NameType
topicT
messageP
optionsPublishOptions

Returns#

Promise<string>

Defined in#

src/service/pubsub.ts:107


shouldStartSynchronousSubscriptions#

Private shouldStartSynchronousSubscriptions(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:119


startServer#

Private startServer(): void

Returns#

void

Defined in#

src/service/pubsub.ts:25


startSubscriptions#

startSubscriptions(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:152


subscribe#

subscribe(subscription): Promise<void>

Subscribes to any given topic

Parameters#

NameType
subscriptionSubscriberTuple

Returns#

Promise<void>

Defined in#

src/service/pubsub.ts:212


syncDriverIsEnabled#

Private syncDriverIsEnabled(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:85


validate#

Protected validate<T, P>(topic, message): void

Validates Topic and Message according to validation rules set in Topic class

Type parameters#

NameType
Textends Topic<T>
Pextends Payload

Parameters#

NameTypeDescription
topicTTopic
messagePMessage

Returns#

void

Defined in#

src/service/pubsub.ts:201


getInstance#

Static getInstance(): PubSubService

Returns#

PubSubService

Defined in#

src/service/pubsub.ts:97


isHealthy#

Static isHealthy(): boolean

Returns#

boolean

Defined in#

src/service/pubsub.ts:48

- + \ No newline at end of file diff --git a/v1/api/classes/Subscriber/index.html b/v1/api/classes/Subscriber/index.html index 6f669433..6e7e9b81 100644 --- a/v1/api/classes/Subscriber/index.html +++ b/v1/api/classes/Subscriber/index.html @@ -6,7 +6,7 @@ Class: Subscriber | Pub/Sub Node.js Framework - + @@ -14,7 +14,7 @@
Version: v1

Class: Subscriber

deprecated

Constructors#

constructor#

new Subscriber()

deprecated

Defined in#

src/subscriber/subscriber.ts:38

Properties#

ackDeadlineSeconds#

Static ackDeadlineSeconds: number = 10

Acknowledge deadline in seconds. If left unset the initial value will be 10 seconds, but it will evolve into the 99th percentile time it takes to acknowledge a message

deprecated in favor of SubscriberV2.metadata.options.ackDeadline

Defined in#

src/subscriber/subscriber.ts:33


description#

Static description: string

deprecated in favor of SubscriberV2.metadata.description

Defined in#

src/subscriber/subscriber.ts:20


maxMessages#

Static maxMessages: number = 1

deprecated in favor of SubscriberV2.metadata.options.flowControl.maxMessages

Defined in#

src/subscriber/subscriber.ts:25


subscriptionName#

Static subscriptionName: string

deprecated in favor of SubscriberV2.metadata.subscriptionName

Defined in#

src/subscriber/subscriber.ts:15


topicName#

Static topicName: string

deprecated in favor of SubscriberV2.metadata.topicName

Defined in#

src/subscriber/subscriber.ts:10

Methods#

handleMessage#

handleMessage(_message): Promise<void>

deprecated

Parameters#

NameType
_messageMessage

Returns#

Promise<void>

Defined in#

src/subscriber/subscriber.ts:53


init#

init(): Promise<void>

deprecated

Returns#

Promise<void>

Defined in#

src/subscriber/subscriber.ts:46

- + \ No newline at end of file diff --git a/v1/api/classes/SubscriptionService/index.html b/v1/api/classes/SubscriptionService/index.html index 9631d33b..dde6ed41 100644 --- a/v1/api/classes/SubscriptionService/index.html +++ b/v1/api/classes/SubscriptionService/index.html @@ -6,14 +6,14 @@ Class: SubscriptionService | Pub/Sub Node.js Framework - +
Version: v1

Class: SubscriptionService

Constructors#

constructor#

new SubscriptionService()

Defined in#

src/service/subscription.ts:26

Properties#

_subscribers#

Static Private _subscribers: Subscribers = []

Defined in#

src/service/subscription.ts:20


defaultSubscriberOptions#

Static defaultSubscriberOptions: SubscriberOptions

Defined in#

src/service/subscription.ts:22


instance#

Static instance: SubscriptionService

Defined in#

src/service/subscription.ts:24


subscribers#

Static subscribers: (typeof Subscriber | typeof default | SubscriberObject)[] = []

Defined in#

src/service/subscription.ts:15

Methods#

checkExistence#

Protected checkExistence(object, property): void

Parameters#

NameType
objectany
propertystring

Returns#

void

Defined in#

src/service/subscription.ts:30


closeAll#

Static closeAll(): Promise<void>

Call this function from a process exit handler to close all current subscriptions

Returns#

Promise<void>

Defined in#

src/service/subscription.ts:59


getSubscribers#

Static getSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/subscription.ts:63


handleError#

Static handleError(error): void

If passed, it would serve as the default error handler at SubscriptionService level Applications should override this with custom error handling

Parameters#

NameType
errorError

Returns#

void

Defined in#

src/service/subscription.ts:49


init#

Static init(): Promise<void>

Returns#

Promise<void>

Defined in#

src/service/subscription.ts:41


loadSubscribers#

Static Private loadSubscribers(): Subscribers

Returns#

Subscribers

Defined in#

src/service/subscription.ts:72


loadSubscriptionService#

Static loadSubscriptionService(): typeof SubscriptionService

Returns#

typeof SubscriptionService

Defined in#

src/service/subscription.ts:112


mergeSubscribers#

Static Private mergeSubscribers(subscribersFromService, subscribersFromDirectory): Subscribers

Parameters#

NameType
subscribersFromServiceSubscribers
subscribersFromDirectorySubscribers

Returns#

Subscribers

Defined in#

src/service/subscription.ts:95

- + \ No newline at end of file diff --git a/v1/api/classes/Topic/index.html b/v1/api/classes/Topic/index.html index 2889e46e..7482741c 100644 --- a/v1/api/classes/Topic/index.html +++ b/v1/api/classes/Topic/index.html @@ -6,13 +6,13 @@ Class: Topic | Pub/Sub Node.js Framework - +
Version: v1

Class: Topic

Implements#

  • NamedTopic
  • TopicWithCustomProject

Constructors#

constructor#

new Topic()

Defined in#

src/topic/index.ts:50

Properties#

mq#

Protected mq: PubSubService

Defined in#

src/topic/index.ts:48


name#

Readonly name: string = ''

Implementation of#

NamedTopic.name

Defined in#

src/topic/index.ts:33


project#

Optional project: GooglePubSubProject

Implementation of#

TopicWithCustomProject.project

Defined in#

src/topic/index.ts:34


retryConfig#

retryConfig: RetryConfig

Defined in#

src/topic/index.ts:36

Methods#

getName#

getName(): string

Returns#

string

Defined in#

src/topic/index.ts:86


publish#

publish<T>(message, options?): Promise<string>

Type parameters#

NameType
Textends Payload

Parameters#

NameType
messageT
options?TopicPublishOptions

Returns#

Promise<string>

Defined in#

src/topic/index.ts:61


validateMessage#

validateMessage(message): void

todo implement message validation logic. tried to link Topic and Message using static name methods, but hit a wall with subclass static inheritance typescript issues

Parameters#

NameTypeDescription
messagePayloadMessage

Returns#

void

Defined in#

src/topic/index.ts:57


validateTopic#

validateTopic(name): void

Parameters#

NameType
namestring

Returns#

void

Defined in#

src/topic/index.ts:90

- + \ No newline at end of file diff --git a/v1/api/index.html b/v1/api/index.html index 2e3f21c1..248a5f89 100644 --- a/v1/api/index.html +++ b/v1/api/index.html @@ -6,13 +6,13 @@ @honestfoodcompany/pubsub | Pub/Sub Node.js Framework - +
- + \ No newline at end of file diff --git a/v1/api/interfaces/Interfaces.BackoffSettings/index.html b/v1/api/interfaces/Interfaces.BackoffSettings/index.html index 1cdb1378..3a236690 100644 --- a/v1/api/interfaces/Interfaces.BackoffSettings/index.html +++ b/v1/api/interfaces/Interfaces.BackoffSettings/index.html @@ -6,13 +6,13 @@ Interface: BackoffSettings | Pub/Sub Node.js Framework - +
Version: v1

Interface: BackoffSettings

Interfaces.BackoffSettings

Properties#

initialRetryDelayMillis#

initialRetryDelayMillis: number

Defined in#

src/interface/publishOptions.ts:62


initialRpcTimeoutMillis#

initialRpcTimeoutMillis: number

Defined in#

src/interface/publishOptions.ts:65


maxRetryDelayMillis#

maxRetryDelayMillis: number

Defined in#

src/interface/publishOptions.ts:64


maxRpcTimeoutMillis#

maxRpcTimeoutMillis: number

Defined in#

src/interface/publishOptions.ts:67


retryDelayMultiplier#

retryDelayMultiplier: number

Defined in#

src/interface/publishOptions.ts:63


rpcTimeoutMultiplier#

rpcTimeoutMultiplier: number

Defined in#

src/interface/publishOptions.ts:66


totalTimeoutMillis#

totalTimeoutMillis: number

Defined in#

src/interface/publishOptions.ts:68

- + \ No newline at end of file diff --git a/v1/api/interfaces/Interfaces.GooglePubSubProject/index.html b/v1/api/interfaces/Interfaces.GooglePubSubProject/index.html index a0380c5c..f142eccf 100644 --- a/v1/api/interfaces/Interfaces.GooglePubSubProject/index.html +++ b/v1/api/interfaces/Interfaces.GooglePubSubProject/index.html @@ -6,13 +6,13 @@ Interface: GooglePubSubProject | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/v1/api/interfaces/Interfaces.PublishOptions/index.html b/v1/api/interfaces/Interfaces.PublishOptions/index.html index d66d6e0a..784c708a 100644 --- a/v1/api/interfaces/Interfaces.PublishOptions/index.html +++ b/v1/api/interfaces/Interfaces.PublishOptions/index.html @@ -6,13 +6,13 @@ Interface: PublishOptions | Pub/Sub Node.js Framework - +
- + \ No newline at end of file diff --git a/v1/api/interfaces/Interfaces.RetryConfig/index.html b/v1/api/interfaces/Interfaces.RetryConfig/index.html index 89b3ffaf..b21b65fb 100644 --- a/v1/api/interfaces/Interfaces.RetryConfig/index.html +++ b/v1/api/interfaces/Interfaces.RetryConfig/index.html @@ -6,7 +6,7 @@ Interface: RetryConfig | Pub/Sub Node.js Framework - + @@ -33,7 +33,7 @@ totalTimeoutMillis: 600000, }, };

Hierarchy#

Properties#

backoffSettings#

backoffSettings: BackoffSettings

Defined in#

src/interface/publishOptions.ts:43


retryCodes#

retryCodes: RetryCodesAllowed[]

Defined in#

src/interface/publishOptions.ts:42

- + \ No newline at end of file diff --git a/v1/api/interfaces/Interfaces.TopicPublishOptions/index.html b/v1/api/interfaces/Interfaces.TopicPublishOptions/index.html index be1a933a..e4bf2ece 100644 --- a/v1/api/interfaces/Interfaces.TopicPublishOptions/index.html +++ b/v1/api/interfaces/Interfaces.TopicPublishOptions/index.html @@ -6,14 +6,14 @@ Interface: TopicPublishOptions | Pub/Sub Node.js Framework - +
Version: v1

Interface: TopicPublishOptions

Interfaces.TopicPublishOptions

This is the user facing type where things are optional and fields are overrides to base config in Topic

Hierarchy#

Properties#

attributes#

Optional attributes: Attributes

Defined in#

src/interface/publishOptions.ts:51


backoffSettings#

Optional backoffSettings: RecursivePartial<BackoffSettings>

Inherited from#

RecursivePartial.backoffSettings

Defined in#

src/interface/publishOptions.ts:43


retryCodes#

Optional retryCodes: (undefined | RecursivePartial<RetryCodesAllowed>)[]

Inherited from#

RecursivePartial.retryCodes

Defined in#

src/interface/publishOptions.ts:42

- + \ No newline at end of file diff --git a/v1/api/interfaces/Interfaces.pubSubClient/index.html b/v1/api/interfaces/Interfaces.pubSubClient/index.html index a93f0013..6d5da5fc 100644 --- a/v1/api/interfaces/Interfaces.pubSubClient/index.html +++ b/v1/api/interfaces/Interfaces.pubSubClient/index.html @@ -6,13 +6,13 @@ Interface: pubSubClient | Pub/Sub Node.js Framework - +
Version: v1

Interface: pubSubClient

Interfaces.pubSubClient

Methods#

getAllSubscriptions#

getAllSubscriptions(): Promise<AllSubscriptions[]>

Returns#

Promise<AllSubscriptions[]>

Defined in#

src/interface/pubSubClient.ts:16


publish#

publish<T, P>(topic, message): Promise<string>

Type parameters#

NameType
Textends Topic<T>
Pextends Payload

Parameters#

NameType
topicT
messageP

Returns#

Promise<string>

Defined in#

src/interface/pubSubClient.ts:11


subscribe#

subscribe(subscriber): void

Parameters#

NameType
subscribertypeof Subscriber

Returns#

void

Defined in#

src/interface/pubSubClient.ts:15

- + \ No newline at end of file diff --git a/v1/api/interfaces/Payload/index.html b/v1/api/interfaces/Payload/index.html index 7e5ab968..5845253d 100644 --- a/v1/api/interfaces/Payload/index.html +++ b/v1/api/interfaces/Payload/index.html @@ -6,14 +6,14 @@ Interface: Payload | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/v1/api/interfaces/SubscriberOptions/index.html b/v1/api/interfaces/SubscriberOptions/index.html index fd99ee91..aefe81c2 100644 --- a/v1/api/interfaces/SubscriberOptions/index.html +++ b/v1/api/interfaces/SubscriberOptions/index.html @@ -6,7 +6,7 @@ Interface: SubscriberOptions | Pub/Sub Node.js Framework - + @@ -19,7 +19,7 @@ then only PubsubMessages whose attributes field matches the filter are delivered on this subscription. If empty, then no messages are filtered out.

Defined in#

src/subscriber/subscriberV2.ts:207


flowControl#

Optional flowControl: FlowControlOptions

Inherited from#

GoogleCloudSubscriberOptions.flowControl

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:107


project#

Optional project: GooglePubSubProject

Defined in#

src/subscriber/subscriberV2.ts:183


retryPolicy#

Optional retryPolicy: Object

Type declaration#

NameType
maximumBackoffObject
maximumBackoff.nanos?number
maximumBackoff.secondsnumber
minimumBackoffObject
minimumBackoff.nanos?number
minimumBackoff.secondsnumber

Defined in#

src/subscriber/subscriberV2.ts:189


streamingOptions#

Optional streamingOptions: MessageStreamOptions

Inherited from#

GoogleCloudSubscriberOptions.streamingOptions

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:109


useLegacyFlowControl#

Optional useLegacyFlowControl: boolean

Inherited from#

GoogleCloudSubscriberOptions.useLegacyFlowControl

Defined in#

node_modules/@google-cloud/pubsub/build/src/subscriber.d.ts:108

- + \ No newline at end of file diff --git a/v1/api/namespaces/Interfaces/index.html b/v1/api/namespaces/Interfaces/index.html index b7fe5a1c..decc4eda 100644 --- a/v1/api/namespaces/Interfaces/index.html +++ b/v1/api/namespaces/Interfaces/index.html @@ -6,13 +6,13 @@ Namespace: Interfaces | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/v1/cli/index.html b/v1/cli/index.html index 031bad09..354c773d 100644 --- a/v1/cli/index.html +++ b/v1/cli/index.html @@ -6,7 +6,7 @@ CLI | Pub/Sub Node.js Framework - + @@ -15,7 +15,7 @@
Google Pub/Sub Subscriptions
Topic name Subscription name Description
simple.topic simple.topic.console-log.subscriptionWithOptions Will console log messages published on test.topic
test.topic test.topic.console-log Will console log messages published on test.topic
test.topic test.topic.console-log.v2 Will console log messages published on test.topic

Subscriptions Start#

This will start a subscription service using the subscription.service.{js/ts} file in your PUBSUB_ROOT_DIR. It will first call the init method of the Service class and then start the subscriptions, allowing you to do any startup tasks. Read more about service here

$ npx subscriptions start
Starting Google Pub/Sub Subscriptions Server
[2021-08-27 10:16:26.824 +0530] INFO: ***** INIT CALLED *****
[2021-08-27 10:16:26.824 +0530] INFO: Connecting to DB
[2021-08-27 10:16:27.829 +0530] INFO: Connected to DB
[2021-08-27 10:16:27.830 +0530] INFO: ***** INIT CALLED *****
[2021-08-27 10:16:29.515 +0530] INFO: ✔️ simple.topic.console-log.subscriptionWithOptions already exists.
[2021-08-27 10:16:43.766 +0530] INFO: 📭 simple.topic.console-log.subscriptionWithOptions is ready to receive messages at a controlled volume of 100 messages.
[2021-08-27 10:16:44.887 +0530] INFO: ✔️ test.topic.console-log already exists.
[2021-08-27 10:16:49.395 +0530] INFO: 📭 test.topic.console-log is ready to receive messages at a controlled volume of 5 messages.
[2021-08-27 10:16:51.349 +0530] INFO: ✔️ test.topic.console-log.v2 already exists.
[2021-08-27 10:17:03.902 +0530] INFO: 📭 test.topic.console-log.v2 is ready to receive messages at a controlled volume of 5 messages.
[2021-08-27 10:17:03.902 +0530] INFO: ✅ All subscriptions started successfully.

Development Environment#

For local use you may want to call the CLI with ts-node instead of directly if you are using typescript.

Usage with Typescript#

For use with Typescript, update your local PUBSUB_ROOT_DIR env var to the src directory of the project with the typescript files.

And instead of using npx subscriptions start you can invoke the bin script with ts-node:

npx ts-node ./node_modules/.bin/subscriptions start

If you have a separate tsconfig for your server code then you should pass it to ts-node:

npx ts-node --project tsconfig.server.json ./node_modules/.bin/subscriptions start

To make this easier you can add a script in your package.json:

{
"scripts": {
"pubsub": "ts-node ./node_modules/.bin/subscriptions start"
}
}

Use Debugger with Typescript#

ts-node doesn't have an --inspect option unlike the node cli. But we can still pass it to the node process by way of the NODE_OPTIONS env var.

NODE_OPTIONS='--inspect' ts-node --project tsconfig.server.json ./node_modules/.bin/subscriptions start

Watch Mode with Typescript#

You can use nodemon in combination with ts-node to develop in watch mode:

{
"scripts": {
"pubsub": "nodemon --exec \"NODE_OPTIONS='--inspect' ts-node --project tsconfig.server.json ./node_modules/.bin/subscriptions start\""
}
}
- + \ No newline at end of file diff --git a/v1/drivers/index.html b/v1/drivers/index.html index e8976bac..f1ec7a2e 100644 --- a/v1/drivers/index.html +++ b/v1/drivers/index.html @@ -6,13 +6,13 @@ PubSub Drivers | Pub/Sub Node.js Framework - +
Version: v1

PubSub Drivers

Google PubSub Driver#

This is the default driver. It uses Google Cloud PubSub to send messages.

It requires the env vars GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_CLOUD_PUB_SUB_PROJECT_ID to function correctly.

note

NOTE: Make sure the service account is assigned the correct roles

The role assigned to the service account in the credentials should be roles/pubsub.admin

This is required because we require the below permissions:

PermissionReason
pubsub.topics.publishPublish to Topic
pubsub.subscriptions.consumeConsume from Subscription
pubsub.topics.getGet Topic to create subscription for it
pubsub.topics.attachSubscriptionCreate subscription for a topic
pubsub.subscriptions.getGet subscription to start consuming it
pubsub.topics.createCreating Topics Automatically (for publishing, subscribing and DLQs)
pubsub.subscriptions.createCreating Subscriptions (for subscribing and DLQs)
resourcemanager.projects.getGet Project Number from Project to bind DLQ policies
pubsub.subscriptions.setIamPolicyAssigning Subscriber Role for DLQs
pubsub.topics.setIamPolicyAssigning Publisher Role for DLQs

Synchronous Driver#

If you would like to bypass Google PubSub and run your subscriptions synchronously (for development purposes) set the following environment variable:

PUBSUB_DRIVER=synchronous

This uses an EventEmitter based pubsub model, and hence only works inside a single process.

caution

NOTE: Not recommended for production use

This is useful for writing unit tests, read more in the testing guide

Features not supported in Synchronous Driver#

  • Filtering using attributes
  • Retrying failed messages
- + \ No newline at end of file diff --git a/v1/getting-started/installation/index.html b/v1/getting-started/installation/index.html index ea276928..d20df3eb 100644 --- a/v1/getting-started/installation/index.html +++ b/v1/getting-started/installation/index.html @@ -6,13 +6,13 @@ Installation | Pub/Sub Node.js Framework - +
Version: v1

Installation

Requirements#

  • Node.js version >= 12.13.0 or above (which can be checked by running node -v). You can use nvm for managing multiple Node versions on a single machine installed

Install#

From NPM#

npm

npm i --save @honestfoodcompany/pubsub

From Github Package Repository#

We also publish to Github Package Repository as @deliveryhero/pubsub. To install from there, first add this to your .npmrc:

@deliveryhero:registry="https://npm.pkg.github.com/"

And then install the package.

npm i --save @deliveryhero/pubsub

Project structure#

The framework expects that you've created a pubsub directory in your project with the following structure:

├── .env <-- this should be in your project root directory and will be autoloaded
├── pubsub/ <-- this can be anywhere and named anything (defined in .env as PUBSUB_ROOT_DIR)
│ ├── subscriptions/ <-- any files ending with a `.sub.js` ext will be autoloaded from here
│ ├── topics/
│ └── subscription.service.js <-- this is the entrypoint for the service
└── package.json

Required Environment Variables#

The framework expects the following environment variables. They can be added to the .env file or passed through CLI args.

.env
PUBSUB_ROOT_DIR=/path/to/your/pubsub/directory # this can be a relative path to process cwd
GOOGLE_APPLICATION_CREDENTIALS=/path/to/gcp-project-83d5537a8388-key.json
GOOGLE_CLOUD_PUB_SUB_PROJECT_ID=gcp-project-id
CLI ArgumentEnv VariableDescription
root-dirPUBSUB_ROOT_DIRmust be the path to your project's pubsub directory. This module only works with .js files, so if you are writing your code in typescript, you must set this variable to the pubsub directory in your project's build directory.
google-application-credentialsGOOGLE_APPLICATION_CREDENTIALSsee https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account to generate this
project-idGOOGLE_CLOUD_PUB_SUB_PROJECT_IDname of the project in Google Cloud Platform
server-portPUBSUB_SERVER_PORTPORT at which the pubsub should run the server at
health-serverPUBSUB_HEALTH_SERVERIf value assigned is true this would run a server showing health state and return 500 if not healthy

|

What next?#

  1. Once the directory structure has been defined and environment variables set
  2. Then you can create subscriptions and topics
  3. Initialize your database connection, define project-level subscription defaults, and register subscriptions in the Subscription Service.
  4. After a service has been created, use the CLI to start the subscriptions server.
- + \ No newline at end of file diff --git a/v1/guides/testing/index.html b/v1/guides/testing/index.html index 136d5815..0abbe21e 100644 --- a/v1/guides/testing/index.html +++ b/v1/guides/testing/index.html @@ -6,13 +6,13 @@ Testing | Pub/Sub Node.js Framework - + - + \ No newline at end of file diff --git a/v1/index.html b/v1/index.html index 14529135..b8de1c8f 100644 --- a/v1/index.html +++ b/v1/index.html @@ -6,13 +6,13 @@ Introduction | Pub/Sub Node.js Framework - +
Version: v1

Introduction

@honestfoodcompany/pubsub#

PubSub is a lightweight framework and subscription server for Google Pub/Sub. It was created to speed up development time ⚡️ and it provides a common foundation for building event driven applications. It lets developers define topics and subscriptions simply and declaratively, while additionally offering a simple subscription server to run all of a project's subscription handlers.

demo of subscription service starting through cli

Features#

PubSub Framework is built with the developer experience in mind.

  • Built with 💚 and Typescript

    • In built types
    • Run with ts-node in dev
  • Easy to setup

    • Define pub/sub subscriptions and topics in a declarative way
    • Define your subscription handlers with a simple object
    • Define a topic and publish messages with a few lines of code
  • ✂️ Developer experience

    • Start receiving messages in minutes
    • Add configuration defaults for all your subscriptions in one place
    • DLQs and IAM automatically handled for you
    • Auto load code from folder
- + \ No newline at end of file diff --git a/v1/options/index.html b/v1/options/index.html index 630e087c..79a917a8 100644 --- a/v1/options/index.html +++ b/v1/options/index.html @@ -6,13 +6,13 @@ Other Options | Pub/Sub Node.js Framework - +
Version: v1

Other Options

Enabling gRPC C++ bindings#

caution

NOTE: DEPRECATED

The native grpc module has been deprecated and we would be removing this option in the future.

For some workflows and environments it might make sense to use the C++ gRPC implementation, instead of the default one. To configure the module to use an alternative grpc transport use the following environment variable:

PUBSUB_USE_GRPC=true
- + \ No newline at end of file diff --git a/v1/publishing/attributes/index.html b/v1/publishing/attributes/index.html index fa456a27..933f9fc4 100644 --- a/v1/publishing/attributes/index.html +++ b/v1/publishing/attributes/index.html @@ -6,14 +6,14 @@ Publishing with Attributes | Pub/Sub Node.js Framework - +
Version: v1

Publishing with Attributes

See: https://cloud.google.com/pubsub/docs/publisher#using_attributes

client.example.ts
import SimpleTopic, { Payload } from 'pubsub/topics/simple.topic.name';
let topic = new SimpleTopic();
topic.publish<Payload>(
{ id: 1, data: 'My first message' },
{
attributes: {
filter: 'a',
company: 'b',
status: 'failed',
},
},
);

These attributes can then be used to filter messages using the filter option in Subscription Options.

- + \ No newline at end of file diff --git a/v1/publishing/publish-diff-project/index.html b/v1/publishing/publish-diff-project/index.html index e7cbdd70..0488a52f 100644 --- a/v1/publishing/publish-diff-project/index.html +++ b/v1/publishing/publish-diff-project/index.html @@ -6,13 +6,13 @@ Publishing on a Different GCP project | Pub/Sub Node.js Framework - +
Version: v1

Publishing on a Different GCP project

/pubsub/topics/example-topic-with-customCredentials.ts
export default class ExampleTopic extends Topic {
public readonly name = 'example-topic-with-customCredentials';
public project: GooglePubSubProject = {
id: 'custom-project-id',
credentials: {
// eslint-disable-next-line
client_email: 'client@google-auth.google.com',
// eslint-disable-next-line
private_key: 'private_key_goes_here'
},
};
}
- + \ No newline at end of file diff --git a/v1/publishing/retry-settings/index.html b/v1/publishing/retry-settings/index.html index f7814e0c..35304b8e 100644 --- a/v1/publishing/retry-settings/index.html +++ b/v1/publishing/retry-settings/index.html @@ -6,14 +6,14 @@ Publishing a message with retry settings | Pub/Sub Node.js Framework - +
Version: v1

Publishing a message with retry settings

caution

NOTE: This may not work right now, it is a known bug.

See Sample Topic with Retry Settings for defining a default retry policy

client.example.ts
import SimpleTopic, { Payload } from 'pubsub/topics/simple.topic.name';
let topic = new SimpleTopic();
topic.publish<Payload>(
{ id: 1, data: 'My first message' },
{
retryCodes: [10, 1],
backoffSettings: {
initialRetryDelayMillis: 100,
},
},
);
- + \ No newline at end of file diff --git a/v1/publishing/topics/index.html b/v1/publishing/topics/index.html index 623aa9ca..b0a290ad 100644 --- a/v1/publishing/topics/index.html +++ b/v1/publishing/topics/index.html @@ -6,7 +6,7 @@ Topics | Pub/Sub Node.js Framework - + @@ -16,7 +16,7 @@
export interface Payload extends BasePayload {
id: number;
data: string;
}
tip

As a convention, the name of the topic file should match the name of the topic name so the file directory becomes self-documenting.

Publishing a message#

If a topic does not exist, it will be created before a message is published.

Typescript example#

client.example.ts
import SimpleTopic, { Payload } from 'PUBSUB_ROOT_DIR/topics/simple.topic.name';
new SimpleTopic().publish<Payload>({ id: 1, data: 'My first message' });

Javascript example#

client.example.js
const SimpleTopic = require('PUBSUB_ROOT_DIR/topics/simple.topic.name');
new SimpleTopic().publish({ id: 1, data: 'My first message' });
- + \ No newline at end of file diff --git a/v1/server/connect-database/index.html b/v1/server/connect-database/index.html index d28891e8..8b02bbbe 100644 --- a/v1/server/connect-database/index.html +++ b/v1/server/connect-database/index.html @@ -6,7 +6,7 @@ Connecting to a Database | Pub/Sub Node.js Framework - + @@ -15,7 +15,7 @@
export default class SubscriptionService extends PubSub.SubscriptionService {
/**
* This function is called when the subscription server starts.
*/
static async init(): Promise<void> {
/**
* This is a good place to initialize a database connection
*/
await mongoose.connect();
}
}
- + \ No newline at end of file diff --git a/v1/server/custom-logger/index.html b/v1/server/custom-logger/index.html index 5fffb39a..6cbd2673 100644 --- a/v1/server/custom-logger/index.html +++ b/v1/server/custom-logger/index.html @@ -6,14 +6,14 @@ Passing a Custom Logger | Pub/Sub Node.js Framework - +
Version: v1

Passing a Custom Logger

In the main SubscriptionService before defining subscription class you can update the logger that is being used by the package for logging. It's an optional definition and by default it uses console.* for logging .info, .warn and .error these 3 function keys are a must have for the logger you pass.

/pubsub/subscription.service.ts
import * as PubSub from '@honestfoodcompany/pubsub';
/**
* This function call is optional, you can pass an instance of Pino, Winston logger
* By default it uses default console.* for logging
* The logger you pass must support .error, .info and .warn methods for it to work
*/
PubSub.setLogger(console);

You can also call setLogger from some other file like a global file, just make sure it gets imported somehow into the subscription.service.

const { setLogger } = require('@honestfoodcompany/pubsub');
setLogger(console);
- + \ No newline at end of file diff --git a/v1/server/graceful-shutdown/index.html b/v1/server/graceful-shutdown/index.html index 9f8334a1..3008e031 100644 --- a/v1/server/graceful-shutdown/index.html +++ b/v1/server/graceful-shutdown/index.html @@ -6,7 +6,7 @@ Graceful Shutdown | Pub/Sub Node.js Framework - + @@ -14,7 +14,7 @@
Version: v1

Graceful Shutdown

When gracefully shutting down a process, it is a good idea to first close all open subscriptions and DB connections. For this reason we have a static closeAll method in the SubscriptionService that can close all connections before shutting down. An example using it with process signal handlers:

/pubsub/subscription.service.ts
import * as PubSub from '@honestfoodcompany/pubsub';
import mongoose from 'mongoose';
import { SubscriberOptions } from '@honestfoodcompany/pubsub';
export default class SubscriptionService extends PubSub.SubscriptionService {
/**
* This function is called when the subscription server starts.
*/
static async init(): Promise<void> {
/**
* This is a good place to initialize a database connection
*/
await mongoose.connect();
}
}
/**
* Example setting up graceful shutdown
*/
process.on('SIGTERM', () => {
// First close all subscriptions
SubscriptionService.closeAll()
.then(() => {
// Then the databse so no new handlers are triggered
return mongoose.disconnect()
.then(() => {
// Then exit the process
process.exit(0);
});
})
.catch((err) => {
console.error(err, 'Could not close subscriptions');
process.exit(1); // Exit with error
});
});
- + \ No newline at end of file diff --git a/v1/server/health-check/index.html b/v1/server/health-check/index.html index 3c2d62e8..8e71a29e 100644 --- a/v1/server/health-check/index.html +++ b/v1/server/health-check/index.html @@ -6,13 +6,13 @@ Health Checks | Pub/Sub Node.js Framework - +
Version: v1

Health Checks

For health checks and readiness probes you can enable the inbuilt health check http server by setting the following environemnt variables (or corresponding CLI option) :

PUBSUB_HEALTH_SERVER=true
PUBSUB_SERVER_PORT=8080

This will expose a very simple http server that checks the static method isHealthy and returns status code accordingly.

You can also define your own server in your app and use the public static method directly as part of your custom health check endpoint.

- + \ No newline at end of file diff --git a/v1/server/service/index.html b/v1/server/service/index.html index d4a59181..6ce59100 100644 --- a/v1/server/service/index.html +++ b/v1/server/service/index.html @@ -6,7 +6,7 @@ Subscription Service | Pub/Sub Node.js Framework - + @@ -20,7 +20,7 @@
SubscriptionService.defaultSubscriberOptions = {
/**
* Define project-level default subscriber options here.
* These options can be overridden by options defined in subscribers
*/
};
SubscriptionService.init = () => {
/**
* This function is called when the subscription server starts.
* This is a good place to initialize a database connection
*/
};
exports.default = SubscriptionService;

Running the Service#

To run the service you can use the CLI commands:

npx subscriptions start
- + \ No newline at end of file diff --git a/v1/subscribing/dead-letter-policy/index.html b/v1/subscribing/dead-letter-policy/index.html index e9d508f0..955c913e 100644 --- a/v1/subscribing/dead-letter-policy/index.html +++ b/v1/subscribing/dead-letter-policy/index.html @@ -6,13 +6,13 @@ Subscriptions with a Dead-letter Policy | Pub/Sub Node.js Framework - +
Version: v1

Subscriptions with a Dead-letter Policy

It is possible to define a dead-letter policy for a subscription. If the dead letter topic does not exist, it will be created automatically by the framework.

"/pubsub/subscriptions/simple.topic.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
options: {
deadLetterPolicy: {
deadLetterTopic: 'test.deadletter.topic',
maxDeliveryAttempts: 15,
createDefaultSubscription: true,
},
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
},
};

Binding Subscriber and Publisher role#

The framework will automatically attach a Publisher & Subscriber role to your dead letter queue, just add a DLQ config and make sure your service account has the roles defined here.

tip

Binding the above policies don't require current subscriptions to be deleted and recreated.

This is following the best practices defined by Google here

Checking for subscribers to DLQ topic#

A dead letter topic is not useful without a subscription for it, because without it all messages are just lost to the void.

To avoid this scenario, we automatically check for subscriptions on the DLQ topic and warn in case the DLQ topic doesn't have any subscriptions. Example warning:

Please set createDefaultSubscription: true in deadLetterPolicy to create default subscriber for dead letter topic of simple.topic.console-log.subscriptionWithOptions. Ignore if already added subscription for it.

Automatically creating default subscribers#

To make it easy to set this up, we have a option createDefaultSubscription that will automatically create a default dead letter subscription with name having .default added to the deadLetterTopic.

For example, if deadLetterTopic is example.test.deadletter then a subscription called example.test.deadletter.default will be automatically created if createDefaultSubscription is true.

- + \ No newline at end of file diff --git a/v1/subscribing/error-handling/index.html b/v1/subscribing/error-handling/index.html index 3eee2775..09cd2613 100644 --- a/v1/subscribing/error-handling/index.html +++ b/v1/subscribing/error-handling/index.html @@ -6,7 +6,7 @@ Internal Error Handling | Pub/Sub Node.js Framework - + @@ -27,7 +27,7 @@
SubscriptionService.init = () => {};
SubscriptionService.handleError = (error) => {
// global default error handling logic for all subscribers
console.error(error);
// Close DB connections/etc here
process.exit(1);
};
exports.default = SubscriptionService;
- + \ No newline at end of file diff --git a/v1/subscribing/message-ordering/index.html b/v1/subscribing/message-ordering/index.html index 693936cb..f1acb1d5 100644 --- a/v1/subscribing/message-ordering/index.html +++ b/v1/subscribing/message-ordering/index.html @@ -6,13 +6,13 @@ Subscription with Message Ordering | Pub/Sub Node.js Framework - +
Version: v1

Subscription with Message Ordering

Messages published with the same ordering_key in PubsubMessage will be delivered to the subscribers in the order in which they are received by the Pub/Sub system.

"/pubsub/subscriptions/simple.topic.name.subscription.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
options: {
enableMessageOrdering: true,
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
},
};
- + \ No newline at end of file diff --git a/v1/subscribing/retry-policy/index.html b/v1/subscribing/retry-policy/index.html index 256e52b3..a83c2ef1 100644 --- a/v1/subscribing/retry-policy/index.html +++ b/v1/subscribing/retry-policy/index.html @@ -6,13 +6,13 @@ Subscriptions with Retry Policy | Pub/Sub Node.js Framework - +
Version: v1

Subscriptions with Retry Policy

It is possible to define a retry configuration for a subscription:

/pubsub/subscriptions/simple.topic.name.subscription.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
options: {
retryPolicy: {
minimumBackoff: { seconds: 20, nanos: 20 },
maximumBackoff: { seconds: 400, nanos: 2 },
},
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
},
};
- + \ No newline at end of file diff --git a/v1/subscribing/subscriptions/index.html b/v1/subscribing/subscriptions/index.html index 599794c2..93487c8c 100644 --- a/v1/subscribing/subscriptions/index.html +++ b/v1/subscribing/subscriptions/index.html @@ -6,7 +6,7 @@ Subscriptions | Pub/Sub Node.js Framework - + @@ -17,7 +17,7 @@
handleError: function(error: Error): void {
// default error handler for subscriber
}
};

Javascript subscription example#

/pubsub/subscriptions/simple.topic.name.sub.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.sub',
description: 'Will console log messages published on test.topic',
handleMessage: function (message) {
console.log(this.subscriptionName, 'received message');
console.log(message.data.toString());
message.ack();
},
};

Subscription example with custom subscriber options#

"/pubsub/subscriptions/simple.topic.name.subscription.js
exports.default = {
topicName: 'test.topic',
subscriptionName: 'test.topic.subscription',
description: 'Will console log messages published on test.topic',
options: {
flowControl: {
maxMessages: 500, // max messages in progress
},
},
handleMessage: function (message) {
console.log(`received a message on ${this.subscriptionName}`);
console.log(message.data.toString());
message.ack();
},
};

Subscriber Options#

See full options available in API Docs.

- + \ No newline at end of file