Solace in typescript on node server

Hi we’ve implemented a solace topic subscriber on our node server with solclientjs.

We currently working with requiring a js module to handle all the solace stuff and that works. But we’re looking to update this to tyoescript.

Would be awesome if you can add @types not really typescript at the moment.

Could not find a declaration file for module 'solclientjs'. '.../node_modules/solclientjs/lib/solclientjs-exports.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/solclientjs` if it exists or add a new declaration (.d.ts) file containing `declare module 'solclientjs';`ts(7016)

are there any alternatives here ?

Another quick thing if you’re reading this… Are there anyway to implement failover URLs for solclientjs.

I know other java services currently listing on the same pubsub are connecting by something like this

solacehost : url1;url2

Are there any alternatives for solclientjs here ?

Hi,
We are working on TypeScript types declaration for SolClientJS and you should be seeing something in the next couple of weeks (possibly sooner).

As for connecting to a hostlist for failover, the solace.SessionProperties.url property can take and array of urls.

Amazing! Really looking forward to having this typed :smiley: Thanks for the info regarding array or urls.
I will try that out and get back to you! :slight_smile:

@jojojo let us know if this works! I’m yet to try it and would like to know how you implemented it ?

Is it available now?

It will be available in the next week or so. We are just finalizing.

Hi @jojojo , and anyone else that stumbles onto this thread… Typescript definitions are now available (have been for a couple months). There is an index.d.ts definitions file included with the tarball you can download from the Solace website, or also on our GitHub samples pages. Details:
Do you use TypeScript? — Solace Community https://solace.com/downloads/?fwp_downloads=solace-apis GitHub - SolaceSamples/solace-samples-nodejs: Getting Started Samples for the Solace Node.js API. GitHub - SolaceSamples/solace-samples-javascript: Getting Started Samples for the Solace JavaScript API.