Subscription protocol response message can be received after a message
See original GitHub issueWhen I remove the first line it works.
const nats = require('nats').connect()
const natsStreaming = require('node-nats-streaming').connect('test-cluster', 'test')
natsStreaming.on('connect', function () {
natsStreaming.publish('foo', 'Hello node-nats-streaming!', function (err, aGuid) {
console.log('Error publishing: ' + aGuid + ' - ' + err)
})
// Subscriber can specify how many existing messages to get.
var opts = natsStreaming.subscriptionOptions().setStartWithLastReceived();
var subscription = natsStreaming.subscribe('foo', opts);
subscription.on('message', function (msg) {
console.log('Received a message [' + msg.getSequence() + '] ' + msg.getData());
})
})
Error:
E:\Repositorys\hemera>node examples\full-example.js
Received a message [9] Hello node-nats-streaming!
events.js:160
throw er; // Unhandled 'error' event
^
Error
at Client.publish (E:\Repositorys\hemera\node_modules\nats\lib\nats.js:1019:13)
at Message.ack (E:\Repositorys\hemera\node_modules\node-nats-streaming\lib\stan.js:748:24)
at Message.maybeAutoAck (E:\Repositorys\hemera\node_modules\node-nats-streaming\lib\stan.js:735:10)
at Object.callback (E:\Repositorys\hemera\node_modules\node-nats-streaming\lib\stan.js:634:11)
at Client.processMsg (E:\Repositorys\hemera\node_modules\nats\lib\nats.js:954:11)
at Client.processInbound (E:\Repositorys\hemera\node_modules\nats\lib\nats.js:882:14)
at Socket.<anonymous> (E:\Repositorys\hemera\node_modules\nats\lib\nats.js:465:12)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Subscription protocol response message can be received ...
What we know: the on message is getting processed before the subscription is ready. There's a 'ready' notification for the subscription, which ...
Read more >Subscribe - Amazon Simple Notification Service
Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when...
Read more >RFC 3265 SIP-Specific Event Notification - IETF
Non-200 class final responses indicate that no subscription or dialog has been created, and no subsequent NOTIFY message will be sent.
Read more >Make sure your endpoint is ready to process Amazon SNS ...
Make sure that your code can handle message delivery retries from Amazon SNS. If Amazon SNS doesn't receive a successful response from your...
Read more >Pull subscriptions | Cloud Pub/Sub Documentation
The Pub/Sub pull subscription can use one of the following two APIs for retrieving messages: Pull; StreamingPull.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The PR will get you going until we determine how/if the server needs to be fixed.
I will try it asap thanks!