<@U078Y59KC3B> Question: Best practices for schema...
# ask-ai
s
@RunLLM Question: Best practices for schema-agnostic Pulsar Functions? I want to write a generic Pulsar Function that can work with any input/output schema without hardcoding schema types. Current approach: • ✅ Input: Using
AUTO_CONSUME
- works great for reading any schema • ❌ Output: Need exact schema match, but
AUTO_PRODUCE
doesn't exist The challenge: To avoid static schemas, I need to get schema info from Pulsar Admin at runtime, but Pulsar Functions don't have access to
PulsarAdmin
(getting errors when trying). Questions: 1. What's the recommended pattern for schema-agnostic functions? 2. How do I discover output topic schema at runtime without Admin access? 3. Any alternatives to runtime schema discovery for generic functions? Goal: One function that works with multiple topic pairs having different schemas (Avro→Avro, JSON→JSON, Avro→JSON, etc.) without recompiling. Anyone solved this or know the best practices? [2:49 AM] Please see we have schema enforcement enabled