Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
No se pudo ejecutar fs.writeFile cuando intenté escribir mi mensaje protobuf en un archivo de texto

Actualmente estoy trabajando en una aplicación que consume un mensaje del corredor RabbitMq, después de consumir el mensaje, mi aplicación debe escribir el contenido en un archivo de texto para uso futuro.

A continuación se muestran mis fragmentos de código:

 const fs = require ('fs'); const config = require('../config.json'); var amqp = require('amqplib/callback_api'); amqp.connect('amqp://localhost' , function(error1 , connection){ if(error1){ throw error1; } connection.createChannel(function(error2 , channel){ if(error2){ throw error2; } channel.assertQueue(config.mode.queue,{ durable : false }); channel.consume(config.mode.queue, function(msg){ let hours = new Date().getHours().toString(); let mins = new Date().getMinutes().toString(); if (mins.length != 2){ mins = "0" + mins console.log(mins) } let timestamp = hours + mins fs.writeFile(`./DataStorage/${timestamp}.txt` , msg.content.toString() , err => { if(err){ console.log(err) return; } }) },{ noAck: true }) }) })

Estoy enfrentando problemas para escribir el mensaje protobuf en un archivo txt, ¿alguien podría proporcionar algún tipo de orientación sobre cómo podría solucionar este problema?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!