cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How many mqtt things can we create in a TWX server?

SK_9989757
6-Contributor

How many mqtt things can we create in a TWX server?

Is there any limit that we can only create max 6000 mqtt things in a given TWX server? 

3 REPLIES 3
M4RC
14-Alexandrite
(To:SK_9989757)

Hello,

 

please check  Composer > Browse > Subsystems > LicensingSubsystem > GetCurrentLicenseInfo > twx_things > AvailableFeatureCount

cf. https://www.ptc.com/en/support/article/CS316279

 

Best regards

Marc

slangley
23-Emerald II
(To:M4RC)

Hi @SK_9989757.

 

Is there some reason you're asking?  This should only be a problem if your contract limits the number of assets.  Refer to the response from @M4RC for determining the number of things allowed.

 

Regards.

 

--Sharon 

Hi @SK_9989757 

 

First, you can check your license limitation as mentioned in another comment. 

 

If it is more than 6000 you can check by yourself using the following script. If the output is the same as the thingcreated then it should work well to create 6000 MQTT things on ThingWorx. You need to set up your own MQTT broker first.

 
thingcreated = 6000;
result = 0;
for (i = 1; i < thingcreated + 1; i++) {
  thingName = "CreatedMQTT-" + i;
  let params = {
    name: thingName /* STRING */,
    description: undefined /* STRING */,
    thingTemplateName: "MQTT" /* THINGTEMPLATENAME */,
    projectName: "PTCDefaultProject" /* PROJECTNAME */,
    tags: undefined /* TAGS */,
  };
  // no return
  Resources["EntityServices"].CreateThing(params);
  let configTable = Things[thingName].GetConfigurationTable({
    tableName: "ConnectionInfo" /* STRING */,
  });
  configTable.rows[0].clientIdFormat = "/Thingworx/{s}/{t}";
  configTable.rows[0].useSSL = false;
  configTable.rows[0].serverName = "localhost";
  configTable.rows[0].serverPort = 1883;
  configTable.rows[0].userId = "testuser";
  configTable.rows[0].password = Resources["EncryptionServices"].EncryptPropertyValue({
    data: "testuser" /* STRING */,
  });
  Things[thingName].SetConfigurationTable({
    configurationTable: configTable /* INFOTABLE */,
    persistent: undefined /* BOOLEAN {"defaultValue":true} */,
    tableName: "ConnectionInfo" /* STRING */,
  });

  // let result = Things[thingName].GetConfigurationTable({
  //   tableName: "ConnectionInfo" /* STRING */,
  // });
  Things[thingName].EnableThing();
  Things[thingName].RestartThing();
  if (Things[thingName].isConnected) {
     result++;
   }
}
 
Best Regards
Announcements


Top Tags