2 Replies Latest reply: Feb 1, 2017 4:35 AM by kbutz RSS

    Observe Thingworx Property Change with Java SDK

    kbutz Copper

      Hi all,


      I'd like to observe a specific property of my Thingworx Thing via Java SDK. Therefore I've created a Thingworx Client, which is connected to Thingworx. After this, I've created a Virtual Thing with my Thingname and added a propertyChangeListener. Unfortunately, the listener does not get fired, as soon as I change the property in Thingworx. Does anyone know where's the problem or where to find an example for this?


      Here's my Code Snippet:

      ClientConfigurator config = new ClientConfigurator();





      try {

        TwxClient client = new TwxClient(config);


        boolean isConnected = client.waitForConnection(30000);


        System.out.println("Client is connected:"+isConnected);


        String thingName = "ThingWatcherThing";

        VirtualThing thing = new VirtualThing(thingName, "", thingName, client);

        thing.addPropertyChangeListener(new VirtualThingPropertyChangeListener() {



           public void propertyChangeEventReceived(VirtualThingPropertyChangeEvent event) {

              Property property = event.getProperty();

              String name = property.getPropertyDefinition().getName();

              if(name.equals("TestProp") == false){





        } );




      } catch (Exception e1) {




      So, where's the problem? Is ist the correct approach?


      Many Greets, Korbinian