Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ingest/pipeline: create new PaymentProcessor #5402

Closed
sreuland opened this issue Jul 26, 2024 · 1 comment
Closed

ingest/pipeline: create new PaymentProcessor #5402

sreuland opened this issue Jul 26, 2024 · 1 comment

Comments

@sreuland
Copy link
Contributor

sreuland commented Jul 26, 2024

What problem does your feature solve?

no common data processors exist based on ingest/pipeline sdk per #5400.

What would you like to see?

Create a new PaymentProcessor as an implementation of a Processor for deriving payments in a pipeline from origin network data - LedgerCloseMeta

Since payments are ubiquitous, implementing a new processor based on this model should be a good stable building block and example of deriving application data model from the network data model as the origin event in the ingest/pipeline SDK.

To receive origin network data, PaymentProcessor.subscribe(inboundChannel Channel) should be passed a Channel that will be carrying Message of type: LedgerCloseMeta. The PaymentProcessor will attach its own MessageHandler function using inboundChannel.Subscribe(MessageHandler). The MessageHandler function should validate that receivedMessages are of type: LedgerCloseMeta , if not, it should log error and drop the message.

The PaymentProcessor will perform an EIP Message Translator role taking the network origin data as input and using same parsing logic as Horizon ingestion of payments to derive payments from the tx-meta.

The PaymentProcessor will populate a new derived application model called PaymentEvent for each payment:

type PaymentEvent struct {
 Timestamp       uint
 BuyerAccountId  string
 SellerAccountId string
 AssetCode       string
 Amount          string
}

The PaymentProcessor will use Json for encoding of thePaymentEvent into the payload which must be byte array.

The PaymentProcessor will perform an EIP Splitter role, it will find many PaymentEvent per each LedgerCloseMeta it receives on inboundChannel, and will wrap each PaymentEvent into a separate Message and emit it individually onto the pipeline via outboundChannel.Send().

Depends on #5400
Depends on #5401

What alternatives are there?

@sreuland
Copy link
Contributor Author

sreuland commented Aug 6, 2024

after processors lib design review, we decided to go with a different approach of pipelines created from observable streams using functional operators, this change is not needed anymore and further obsoleted by #5413 and #5414

@sreuland sreuland closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant