Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

517 B
Raw Blame
import { Message } from 'node-rdkafka'

/**
 * Helper function to create a Kafka Message for tests with sensible defaults.
 *
 * @param overrides - Partial Message to override defaults
 * @returns Complete Message object
 */
export function createTestMessage(overrides: Partial<Message> = {}): Message {
    return {
        value: Buffer.from('test-value'),
        key: Buffer.from('test-key'),
        offset: 100,
        partition: 5,
        topic: 'test-topic',
        size: 10,
        ...overrides,
    }
}