Send does not work, gives WaitingForDNS error yet connect() doesn't fail


I'm not sure whether my earlier post was misplaced, hopefully this is a better place.

I'm trying to do a pub/sub tutorial, both publishing 1 message and subscribing to the queue. The original JS code as Solace created on Github. I'm trying to Typescript-ify the code and now it says

OperationError: Cannot perform operation SEND while in state WaitingForDNS

PING resolves the host URL to an IP address, so at the very least, this message is misleading.

This happens on a session.send(solaceMessage);

The session.connect() call, however, does not throw an exception. However, if there really was a DNS issue, it should have happened at that point.


  • giri
    giri Member, Administrator, Employee Posts: 108 admin

    Hi @benprachtrsi, I think this is a duplicate of another thread you opened on this topic. Did you get a chance to review @Tamimi 's response to check for the UP_NOTICE before attempting to send a message?

    Can you attempt to register an event listener for the UP_NOTICE event and execute your publish command after that?

    The other thread has a good discussion around this - let us track it there. Hope that should be fine!