Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Nodejs: subscriber timeout #16

Closed
kranthisai opened this issue Feb 1, 2017 · 2 comments
Closed

Nodejs: subscriber timeout #16

kranthisai opened this issue Feb 1, 2017 · 2 comments

Comments

@kranthisai
Copy link

I am seeing this issue today. It occasionally throws following error.

/home/ubuntu/workspace/axon-winjit-bridge/node_modules/amqp10/lib/frames.js:54
stream.write(buffer);
^

TypeError: Cannot read property 'write' of null
at Object.frames.writeFrame (/home/ubuntu/workspace/axon-winjit-bridge/node_modules/amqp10/lib/frames.js:54:9)
at Connection.sendFrame (/home/ubuntu/workspace/axon-winjit-bridge/node_modules/amqp10/lib/connection.js:333:10)
at ReceiverLink.Link.attach (/home/ubuntu/workspace/axon-winjit-bridge/node_modules/amqp10/lib/link.js:108:27)
at ReceiverLink.Link._attemptReattach (/home/ubuntu/workspace/axon-winjit-bridge/node_modules/amqp10/lib/link.js:237:8)
at Timeout._onTimeout (/home/ubuntu/workspace/axon-winjit-bridge/node_modules/amqp10/lib/link.js:225:10)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)

--sample Code

const client = EventHubClient.fromConnectionString(connectionString);
const receiveAfterTime = Date.now() - 5000;

client.open()
.then(client.getPartitionIds.bind(client))
.then(partitionIds =>
partitionIds.map(partitionId =>
client.createReceiver('$Default', partitionId, { startAfterTime: receiveAfterTime })
.then(receiver => {
receiver.on('errorReceived', logger.error);
receiver.on('message', processEventQueue);
}).catch(logger.error)
)
).catch(logger.error);

@mharj
Copy link

mharj commented Feb 2, 2017

I have this same issue for few days already.
Currently fails to start ~9 times out of 10 .

@kranthisai
Copy link
Author

I resolved the issue today..

just caught the exception

process.on('uncaughtException', err => {
console.log('Caught exception: ', err);
});

It will not terminate the app. Will wait for connection to establish..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants