-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: R.I.Pienaar <[email protected]>
- Loading branch information
Showing
13 changed files
with
404 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package advisory | ||
|
||
import "github.com/nats-io/jsm.go/api/event" | ||
|
||
// JSConsumerGroupPinnedAdvisoryV1 is an advisory published when a consumer pinned_client grouped consumer pins a client | ||
// | ||
// NATS Schema Type io.nats.jetstream.advisory.v1.consumer_group_pinned | ||
type JSConsumerGroupPinnedAdvisoryV1 struct { | ||
event.NATSEvent | ||
|
||
Account string `json:"account,omitempty"` | ||
Stream string `json:"stream"` | ||
Consumer string `json:"consumer"` | ||
Domain string `json:"domain,omitempty"` | ||
Group string `json:"group"` | ||
PinnedClientId string `json:"pinned_id"` | ||
} | ||
|
||
func init() { | ||
err := event.RegisterTextCompactTemplate("io.nats.jetstream.advisory.v1.consumer_group_pinned", `{{ .Time | ShortTime }} [PINNED] Consumer {{ .Stream }} > {{ .Consumer }} pinned client {{ .PinnedClientId }} for group {{ .Group }}`) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
err = event.RegisterTextExtendedTemplate("io.nats.jetstream.advisory.v1.consumer_group_pinned", ` | ||
[{{ .Time | ShortTime }}] [{{ .ID }}] Grouped Consumer Pinned a Client | ||
Stream: {{ .Stream }} | ||
Consumer: {{ .Consumer }} | ||
Group: {{ .Group }} | ||
Domain: {{ .Domain }} | ||
Pinned Client: {{ .PinnedClientId }}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package advisory | ||
|
||
import "github.com/nats-io/jsm.go/api/event" | ||
|
||
// JSConsumerGroupUnPinnedAdvisoryV1 is an advisory published when a consumer pinned_client grouped consumer unpins a client | ||
// | ||
// NATS Schema Type io.nats.jetstream.advisory.v1.consumer_group_unpinned | ||
type JSConsumerGroupUnPinnedAdvisoryV1 struct { | ||
event.NATSEvent | ||
|
||
Account string `json:"account,omitempty"` | ||
Stream string `json:"stream"` | ||
Consumer string `json:"consumer"` | ||
Domain string `json:"domain,omitempty"` | ||
Group string `json:"group"` | ||
Reason string `json:"reason"` | ||
} | ||
|
||
func init() { | ||
err := event.RegisterTextCompactTemplate("io.nats.jetstream.advisory.v1.consumer_group_unpinned", `{{ .Time | ShortTime }} [UNPINNED] Consumer {{ .Stream }} > {{ .Consumer }} unpinned client for group {{ .Group }}: {{ .Reason }}`) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
err = event.RegisterTextExtendedTemplate("io.nats.jetstream.advisory.v1.consumer_group_unpinned", ` | ||
[{{ .Time | ShortTime }}] [{{ .ID }}] Grouped Consumer Un-Pinned a Client | ||
Stream: {{ .Stream }} | ||
Consumer: {{ .Consumer }} | ||
Group: {{ .Group }} | ||
Domain: {{ .Domain }} | ||
Reason: {{ .Reason }}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
schema_source/jetstream/advisory/v1/consumer_group_pinned.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://nats.io/schemas/jetstream/advisory/v1/consumer_group_pinned.json", | ||
"description": "An Advisory sent when a pinned_client grouped consumer pinned a client", | ||
"title": "io.nats.jetstream.advisory.v1.consumer_group_pinned", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"id", | ||
"timestamp", | ||
"server", | ||
"stream", | ||
"consumer", | ||
"group", | ||
"pinned_id" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"const": "io.nats.jetstream.advisory.v1.consumer_group_pinned" | ||
}, | ||
"id": { | ||
"type": "string", | ||
"description": "Unique correlation ID for this event" | ||
}, | ||
"timestamp": { | ||
"type": "string", | ||
"description": "The time this event was created in RFC3339 format" | ||
}, | ||
"account": { | ||
"type": "string", | ||
"description": "The account hosting the consumer" | ||
}, | ||
"stream": { | ||
"type": "string", | ||
"description": "The stream hosting the consumer" | ||
}, | ||
"consumer": { | ||
"type": "string", | ||
"description": "The consumer name" | ||
}, | ||
"domain": { | ||
"type": "string", | ||
"minLength": 1, | ||
"description": "The domain of the JetStreamServer" | ||
}, | ||
"group": { | ||
"type": "string", | ||
"description": "The group that unpinned a client" | ||
}, | ||
"pinned_id": { | ||
"type": "string", | ||
"description": "The unique server-assigned ID for the client" | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
schema_source/jetstream/advisory/v1/consumer_group_unpinned.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://nats.io/schemas/jetstream/advisory/v1/consumer_group_unpinned.json", | ||
"description": "An Advisory sent when a pinned_client grouped consumer unpinned a client", | ||
"title": "io.nats.jetstream.advisory.v1.consumer_group_unpinned", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"id", | ||
"timestamp", | ||
"server", | ||
"stream", | ||
"consumer", | ||
"group", | ||
"reason" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"const": "io.nats.jetstream.advisory.v1.consumer_group_unpinned" | ||
}, | ||
"id": { | ||
"type": "string", | ||
"description": "Unique correlation ID for this event" | ||
}, | ||
"timestamp": { | ||
"type": "string", | ||
"description": "The time this event was created in RFC3339 format" | ||
}, | ||
"account": { | ||
"type": "string", | ||
"description": "The account hosting the consumer" | ||
}, | ||
"stream": { | ||
"type": "string", | ||
"description": "The stream hosting the consumer" | ||
}, | ||
"consumer": { | ||
"type": "string", | ||
"description": "The consumer name" | ||
}, | ||
"domain": { | ||
"type": "string", | ||
"minLength": 1, | ||
"description": "The domain of the JetStreamServer" | ||
}, | ||
"group": { | ||
"type": "string", | ||
"description": "The group that unpinned a client" | ||
}, | ||
"reason": { | ||
"type": "string", | ||
"enum": ["admin", "timeout"], | ||
"description": "The reason the client was unpinned" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://nats.io/schemas/jetstream/advisory/v1/consumer_group_pinned.json", | ||
"description": "An Advisory sent when a pinned_client grouped consumer pinned a client", | ||
"title": "io.nats.jetstream.advisory.v1.consumer_group_pinned", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"id", | ||
"timestamp", | ||
"server", | ||
"stream", | ||
"consumer", | ||
"group", | ||
"pinned_id" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"const": "io.nats.jetstream.advisory.v1.consumer_group_pinned" | ||
}, | ||
"id": { | ||
"type": "string", | ||
"description": "Unique correlation ID for this event" | ||
}, | ||
"timestamp": { | ||
"type": "string", | ||
"description": "The time this event was created in RFC3339 format" | ||
}, | ||
"account": { | ||
"type": "string", | ||
"description": "The account hosting the consumer" | ||
}, | ||
"stream": { | ||
"type": "string", | ||
"description": "The stream hosting the consumer" | ||
}, | ||
"consumer": { | ||
"type": "string", | ||
"description": "The consumer name" | ||
}, | ||
"domain": { | ||
"type": "string", | ||
"minLength": 1, | ||
"description": "The domain of the JetStreamServer" | ||
}, | ||
"group": { | ||
"type": "string", | ||
"description": "The group that unpinned a client" | ||
}, | ||
"pinned_id": { | ||
"type": "string", | ||
"description": "The unique server-assigned ID for the client" | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
schemas/jetstream/advisory/v1/consumer_group_unpinned.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://nats.io/schemas/jetstream/advisory/v1/consumer_group_unpinned.json", | ||
"description": "An Advisory sent when a pinned_client grouped consumer unpinned a client", | ||
"title": "io.nats.jetstream.advisory.v1.consumer_group_unpinned", | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"id", | ||
"timestamp", | ||
"server", | ||
"stream", | ||
"consumer", | ||
"group", | ||
"reason" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"const": "io.nats.jetstream.advisory.v1.consumer_group_unpinned" | ||
}, | ||
"id": { | ||
"type": "string", | ||
"description": "Unique correlation ID for this event" | ||
}, | ||
"timestamp": { | ||
"type": "string", | ||
"description": "The time this event was created in RFC3339 format" | ||
}, | ||
"account": { | ||
"type": "string", | ||
"description": "The account hosting the consumer" | ||
}, | ||
"stream": { | ||
"type": "string", | ||
"description": "The stream hosting the consumer" | ||
}, | ||
"consumer": { | ||
"type": "string", | ||
"description": "The consumer name" | ||
}, | ||
"domain": { | ||
"type": "string", | ||
"minLength": 1, | ||
"description": "The domain of the JetStreamServer" | ||
}, | ||
"group": { | ||
"type": "string", | ||
"description": "The group that unpinned a client" | ||
}, | ||
"reason": { | ||
"type": "string", | ||
"enum": [ | ||
"admin", | ||
"timeout" | ||
], | ||
"description": "The reason the client was unpinned" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.