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

Add an sqs destination. #23

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add an sqs destination. #23

wants to merge 3 commits into from

Conversation

ejcx
Copy link
Contributor

@ejcx ejcx commented Aug 13, 2023

No description provided.

@ejcx
Copy link
Contributor Author

ejcx commented Aug 14, 2023

Got this working!

}

type sqs struct {
batcher *batch.Destination[types.Event]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

types.Event -> []byte

for _, msg := range msgs {
messageRequest := &awssqs.SendMessageBatchRequestEntry{
Id: aws.String(ksuid.New().String()),
MessageBody: aws.String(string(msg.Value.RawLog)),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msg.Value.RawLog -> msg.Value.

Copy link
Contributor

@abraithwaite abraithwaite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, almost to where I'd imagine it needs to be.

I also removed the top-level internal/destinations directory. Now everything lives under kawa/x/{plugin} or kawa/cmd/kawad/internal/{sources,destinations}. The []byte source and destination would go under x/sqs, and the types.Event implementation would go under cmd/kawad/internal/destinations.

Then, when registering the plugin here, we'd use the types.Event implementation.

LMK if this makes sense or if you think the indirection is too much. I like the idea of reusing sources carrying different serialized data in bytes, but also don't love how the source/destination wrappers look currently.

@@ -34,6 +35,9 @@ func init() {
loader.Register("printer", func() loader.Builder[kawa.Destination[types.Event]] {
return &PrinterConfig{}
})
loader.Register("sqs", func() loader.Builder[kawa.Destination[[]byte]] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be types.Event, which requires implementing a small shim between bytes and types.Event.

See @harpesichord's PR for MQTT for an example:

https://github.com/runreveal/kawa/pull/22/files#diff-c98d0db234d358f55fa681b43ed3ae5cceb2257c3c44c4e77c1475b36af04cc2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants