kafkaproxy icon indicating copy to clipboard operation
kafkaproxy copied to clipboard

Is it possible to use this proxy code to intercept messages?

Open osoykan opened this issue 2 months ago • 0 comments

Hi,

I would like to capture what is consumed and published from an application, and I want the application to go through a Kafka proxy. Does this source code (without docker image) serve this purpose if I used it as a library in my code-base?

Idea:

graph LR
    A[Application]
    subgraph KP[Kafka Proxy]
        B[Consumer]
        C[Producer]
        S[In Memory Message Store]
    end
    A --> KP
    KP --> K[Kafka]
    K --> KP
    subgraph T[Testing]
      V[Observation, shouldBeConsumed, shouldBePublished]
    end
    KP --> T
    KP --> A 
 kafka {
        shouldBePublished<ExampleMessage> {
            actual.aggregateId == 123 
                    && actual.metadata.topic = "example-topic" 
                    && actual.metadata.headers["example-header"] == "example-value"
        }
        shouldBeConsumed<ExampleMessage> {
            actual.aggregateId == 123
                    && actual.metadata.topic = "example-topic"
                    && actual.metadata.headers["example-header"] == "example-value"
        }
    }

The need is coming from this library that I ve been developing: https://github.com/Trendyol/stove

Do you think that the idea is possible with the proxy?

osoykan avatar Apr 02 '24 10:04 osoykan