kubemq-io / kubemq-node

MIT License
18 stars 8 forks source link

How to properly use transaction. #5

Closed stephen-dahl closed 4 years ago

stephen-dahl commented 4 years ago

I am following the Transactional Queue - Ack and reject example. Whenever transaction.closeStream(); is called the error handler is immediately called with this error

Error: 1 CANCELLED: Cancelled
    at Object.exports.createStatusError (c:\Users\steph\PhpstormProjects\response-rollup-loader\node_modules\grpc\src\common.js:91:15)
    at ClientDuplexStream._emitStatusIfDone (c:\Users\steph\PhpstormProjects\response-rollup-loader\node_modules\grpc\src\client.js:233:26)
    at ClientDuplexStream._readsDone (c:\Users\steph\PhpstormProjects\response-rollup-loader\node_modules\grpc\src\client.js:199:8)
    at c:\Users\steph\PhpstormProjects\response-rollup-loader\node_modules\grpc\src\client_interceptors.js:683:15

Is there more that needs to happen after the message has been ack'd?

eitam-ring commented 4 years ago

Hey, You are receiving "CANCELLED: Cancelled" when calling transaction.closeStream(); since the stream is closed. You can check the error type on the listener of the error handler.

stephen-dahl commented 4 years ago

I just would not expect to receive an error when properly closing a stream