Estoy trabajando en TypeScript con la biblioteca KafkaJS localmente, con un solo agente kafka. Conecté con éxito a un productor, verifiqué que se creó mi tema y estoy generando mensajes con:
const changeMessage = { key: id, value: JSON.stringify(person), headers: { changeType: status, }, };Ahora cuando voy a enviar el mensaje:
try { const sendResponse = await producer.send({ topic: topicName2, messages: [changeMessage], }); log.responseFragment( { id, topicName2 }, `Sending changed/added person ${id} to topic ${topicName2}` ); } catch (error) { log.error( { error }, `Could not send personChangedAdded ${id} to topic ${topicName2}` ); }Aquí está el error que me devuelve:
Could not send personChange to topic topicName2 error: { "name": "KafkaJSError", "retriable": true }No pude definir log.responseFragment() , y cuando lo cambié a un simple log.info() el problema se resolvió.