Enable accessing Message in TableView

Aperta
#1,176 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

  • #1174 di @petermnhull — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
api

Direzione di ricerca

Individua l’interfaccia TableView e il percorso processMessage, quindi esamina come i metodi esistenti Get ed Entries memorizzano e restituiscono i payload. Determina come i metodi richiesti Message e Messages possano preservare questi comportamenti esistenti esponendo al contempo i metadati dei messaggi; il lavoro è completo quando entrambi i nuovi percorsi di accesso funzionano senza compromettere i metodi attuali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is your feature request related to a problem? Please describe.
I have a use case for processing messages in a TableView where I need to be able to access the metadata (e.g. publication time) for each message, for example to check if the message for a key is "out-of-date" or recent.

Currently this is not possible as the TableView implementation only provides the message as encoded by the SchemaValueType and discards all metadata.

Describe the solution you'd like
I would like to introduce two new methods to the TableView interface for accessing the associated pulsar.Message for each key:

  1. Message(key string) Message - access the pulsar.Message for a given key (as an alternative to Get)
    2.Messages() map[string]Message - access all the stored pulsar.Message objects for each key (as an alternative to Entries)

I propose to do this by changing how the messages are processed - instead of storing the encoded payload in processMessage, instead we store a map of map[string]Message. Backwards compatibility will be maintained by always returning the payload in the existing methods.

Describe alternatives you've considered
Alternatives include:
There are no current alternatives for accessing message metadata while using TableView.

Instead of changing any of the storage implementation, we can add a new map which additionally stores a mapping from key to pulsar.Message, and only use this map for the two new methods. I initially decided against this to avoid duplicating the logic for storing messages.

Additional context
NA.

Please let me know if this requires any further design or improvement documentation, happy to provide more detail if needed.

Lingua principale
Go
Stelle
746
Fork
394
Merge medio
6g 13h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/pulsar-client-go

Tutte le issue di apache/pulsar-client-go

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.