Comments (9)
Reviewed all the inputs and added metadata from the ones I felt made sense.
from benthos.
I've been working on a version of the amqp input that includes all but Acknowledger and MessageCount from the amqp.Delivery struct. Still working out the nesting of amqp.Table in Delivery.Headers. I'll send you a PR when I'm done to see if you can use any of it.
from benthos.
I've just pushed an API change that allows per message metadata in batches and updated all the existing components to use it.
from benthos.
What are your thoughts on allowing metadata on message
s in addition to part
s? I have a processor that is turning a multi-part message into N new messages (basically performing a group-by) and it'd be handy if I could enrich each outgoing message
with metadata about the grouping.
from benthos.
Hey @seanlaff, how would you intend on using the metadata? For cases like that I would usually either suggest setting and referring to the batch wide metadata on the first part, or just set the field on all parts.
from benthos.
@Jeffail Inspecting the metadata on the first part is the solution I opted for in the end, and works pretty well. My use case may be a little contrived, but this is what it looks like:
Data is streamed from pubsub to a benthos batch processor, and then to a database sink. However the database table that the data is written into depends on a dynamic field in the message. Additionally, the database does not support writing to multiple tables in one request.
My first solution was to spin up goroutines in the output to handle writing to the N discrete tables concurrently- but that felt like work I could relegate to benthos itself. Instead, I opted to create a processor (executed after the batch processor) that creates N new multi-part message, with each message containing all parts that share the same keying field. Then in my output I inspect the metadata of the first part, and make a singular database write for the correct table for all parts of that message at once (thus leaning on benthos to do the concurrent work I was doing by hand before)
This may be a non-idomatic use of benthos- and is only a minor inconvenience since I can achieve the same by checking the metadata on the first part
from benthos.
@seanlaff, sounds like a reasonable approach. Let me know if you hit any issues with doing it this way and I'll take another look.
from benthos.
@Jeffail I've raised a PR for a candidate implementation of metadata with the Kafka output type - happy to address any comments there.
from benthos.
Closing this as it's become stale. The bulk of the work is done, anything else can be tackled if/when people need it.
from benthos.
Related Issues (20)
- Flipt Processor
- Metric mapping not working in main branch HOT 1
- Keyed window buffer
- Tracing - Adding span tags into processor/input/output spans based on message's attributes
- Benthos logs should include trace_id, span_id and trace_flags when tracing is enabled HOT 1
- Asyn preserver blocking shutdowns (http_client input with streaming enabled)
- OpenTelemetry tracing errors should use RecordError function
- Tracing implementation LogKV usage is incorrect throughout the codebase
- Increase tracing coverage throughout our components
- Add docs generation to benthos cli as a command
- Created by mistake
- ERRO Connection lost due to: EOF HOT 1
- No data consumed since update with 4.24.0 with batch_size at 1 HOT 2
- Memory leak issue with Benthos memory cache HOT 3
- Feature Request - 'limit' for sqlite buffer
- Failed to write output data to ORACLE date type field HOT 1
- Unable to explicitly set no key in kafka franz output HOT 3
- "sql_insert" failed with ERROR ...too many parameters in Microsoft SQL server HOT 1
- How to fail to exit HOT 1
- Cannot decompress HTTP POST gzipped JSON HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from benthos.