abreits / amqp-ts

AmqpSimple, a RabbitMQ tested Amqp library written in and for Typescript
MIT License
133 stars 37 forks source link

Queue.onMessage RPC promise returned error: mapper_parsing_exception module=amqp-ts #53

Open TanyaDolgopolova opened 4 years ago

TanyaDolgopolova commented 4 years ago

I try to send a message to the queue, after that I see this error.

Queue.onMessage RPC promise returned error: mapper_parsing_exception module=amqp-ts

I cannot understand what I am doing wrong. This is my worker code:

const exchange = connection.declareExchange(process.env.OBJECT_CHILD_QUEUE);
  const queue = connection.declareQueue(process.env.OBJECT_CHILD_QUEUE, {
    prefetch: 1,
  });
  queue.bind(exchange);
  queue.activateConsumer(
    async (message) => {
      const messageID = message.getContent();
      await service.subscribe(
        messageID,
        (retry: boolean) => {
          if (retry) {
            message.nack();
          } else {
            message.ack();
          }
        }
      );
    },
    { noAck: false, manualAck: true }
  );