Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Error while processing message

    Test
    0
    1
    3
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sonivipul89 last edited by

      @admin
      I am trying to implement websocket 2.0 in node SDK,
      but it shows "Error while processing message"
      can you please help me, what i am doing wrong in my code

      const feed = {
      
              "correlationID": "abcde12345",
      
              "action": 1,
      
              "params": {
      
                   "mode": 1,
      
                   "tokenList": [
      
                        {
      
                             "exchangeType": 2,
      
                             "tokens": [
      
                                  "55429"
      
                             ]
      
                        }
      
                   ]
      
              }
      
         } new WebSocketClient({
          clientcode: process.env.CLIENT_CODE,
          jwttoken: session.get("access_token"),
          apikey: process.env.API_KEY,
          feedtype: JSON.stringify(feed)
      });
      
      
      ws2.connect()
          .then(() => {
              ws2.fetchData("subscribe",JSON.stringify(feed));  // ACTION_TYPE: subscribe | unsubscribe FEED_TYPE: order_feed
              setTimeout(function () {
                  ws2.close()
              }, 60000)
          })
          
      ws2.on('tick', receiveTick);
      
      function receiveTick(data) {
          console.log("receiveTick:::::", data);
      }
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post