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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Java SDK Thingworx message Size too large

drieder
15-Moonstone

Java SDK Thingworx message Size too large

Hello everyone,

 

I am trying to update properties of a thing which is binded to a virtual thing in my Java environment. During the updateSubscribedProperties() call I get the following Error:

 

ERROR c.t.c.client.things.VirtualThing - Unable To Update Subscribed Properties For propName : Thingworx message size too large: 55282

 

Note: I am trying to set an ImagePrimitive here. The ImagePrimitive is created with a byte[] array of size 27k which is 27kilobytes in total.

 

I already checked the FileTransferSubsystem and the maxBlocksize is set to 128k so I don't see a problem there. Any Ideas how to resolve this? Should I use a different aproach for setting image properties maybe?

 

Best Regards,

Dominik

1 ACCEPTED SOLUTION

Accepted Solutions
cbuse
12-Amethyst
(To:drieder)

Hi Dominik,

 

A different approach would be to transfer the image from a remote repository on the device in a ThingWorx repository using the Copy service from FileTransferSubsystem, then use service LoadImage from the file repository to get the image, then assign it to a property on the thing.

You would need to extend FileTransferVirtualThing instead of VirtualThing in order to use file transfer. The Java method for adding a remote repository is addVirtualDirectory("AssetRepo",  "E:/AssetRepo").

 

Best regards,

Cristina

View solution in original post

5 REPLIES 5
cbuse
12-Amethyst
(To:drieder)

Hi Dominik,

 

A different approach would be to transfer the image from a remote repository on the device in a ThingWorx repository using the Copy service from FileTransferSubsystem, then use service LoadImage from the file repository to get the image, then assign it to a property on the thing.

You would need to extend FileTransferVirtualThing instead of VirtualThing in order to use file transfer. The Java method for adding a remote repository is addVirtualDirectory("AssetRepo",  "E:/AssetRepo").

 

Best regards,

Cristina

drieder
15-Moonstone
(To:cbuse)

Hello Christina,

 

thank you very much for your reply. I will try this out and let you know whether it worked.

 

Best Regards,

Dominik

drieder
15-Moonstone
(To:cbuse)

Hello again Christina,

 

will this also work for hosted servers? I am wondering because I can't see/access any repositories from the foundation server.

 

Regards,

Dominik

cbuse
12-Amethyst
(To:drieder)

Hi Dominik,

 

The transfer from the device repository to the hosted ThingWorx repository is achieved via WebSockets protocol. There are ThingWorx APIs available to interact with the hosted ThingWorx repository content such as GetDirectoryStructure, GetFileListingWithLinks, SaveText, etc.

 

Best regards,

Cristina

drieder
15-Moonstone
(To:cbuse)

Hello Christina,

 

thank you again. Maybe you could also check out this thread I opened. Since I will update the images frequently (its a live stream actually) I feel this approach might be too exhaustive, so I would like to do these updates via Rest calls.

 

Regards,

Dominik

Top Tags