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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Java Edge SDK dynamic properties values to not get pushed to the platform

VladimirRosu
18-Opal

Java Edge SDK dynamic properties values to not get pushed to the platform

Hi all,

I used the path of creating a variable number of properties in my Edge SDK implementation, based on the number of elements from an XML I receive from an URL.

The problem is that the properties are not being sent to the platform in PUSH mode.

The properties are being discovered correctly via Manage Bindings and everything is setup OK (push ALWAYS, Read from server cache etc.)

I have the call to updateSubscribedProperties, but as I can see, the EMS can't get the property subscriptions (I guess).

In PULL mode it works.

Java SDK is 5-0-1-103, tomcat 8, ThingWorx 6.5.

Any idea of why it doesn't work?

Below it's a sample from the SDK log:

15:53:49.178 [Client-EndpointMonitor-1] INFO  c.t.c.c.e.ClientCommunicationEndpoint - Preparing new Connection Authentication Request: DispatchingClientEndpoint [id: 0, isConnected: false, open connections: 0, max connections: 1]

15:53:49.179 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.CommunicationEndpoint - Sending connection authentication message, waiting for response [sync key: 1, message: AuthRequestMessage [requestId: 1, endpointId: -1, sessionId: -1, method: AUTHREQUEST]]

15:53:49.182 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=2 length=60

15:53:49.184 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

15:53:49.185 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

15:53:49.185 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=17

15:53:49.195 [NettyClient-NIO-1] DEBUG c.t.c.c.e.DispatchingClientEndpoint - RESPONSE received [endpoint id: 0, duration: 16] ResponseMessage [requestId: 1, endpointId: 28, sessionId: 28, code: STATUS_SUCCESS, multipart: false, packet #: 0, total packets: 0]

15:53:49.195 [Client-EndpointMonitor-1] INFO  c.t.c.c.e.ClientCommunicationEndpoint - Authentication Request was SUCCESSFUL [tworx session id: 28, connection group id: 28]

15:53:49.196 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.CommunicationEndpoint - [Endpoint id: 0, connection id: 0-0] added Connection

15:53:49.196 [Client-EndpointMonitor-1] INFO  c.t.c.c.e.ClientCommunicationEndpoint - Successfully reconnected client endpoint [id: 0] : [active: 1, max: 1]

15:53:49.196 [Client-EndpointMonitor-1] INFO  c.t.c.client.ConnectedThingClient - Communications Endpoint Opened

15:53:49.197 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.CommunicationEndpoint - Sending synchronous message, waiting for response [sync key: 2, message: BindRequestMessage [requestId: 2, method: BINDREQUEST, names: [*DeviceSN1, *DeviceSN2, *DeviceSN3]]]

15:53:49.197 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=2 length=51

15:53:49.199 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

15:53:49.200 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

15:53:49.200 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=17

15:53:49.200 [NettyClient-NIO-1] DEBUG c.t.c.c.e.DispatchingClientEndpoint - RESPONSE received [endpoint id: 0, duration: 3] ResponseMessage [requestId: 2, endpointId: -1, sessionId: -1, code: STATUS_SUCCESS, multipart: false, packet #: 0, total packets: 0]

15:53:49.200 [Client-EndpointMonitor-1] INFO  c.t.c.c.e.m.CommunicationEndpointMonitorTask - Endpoint reconnected [name: RaspberryXGateway, id: 0]

15:53:50.201 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

15:53:50.201 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame opCode=2

15:53:50.201 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameDecoder - Decoding WebSocket Frame length=51

15:53:50.204 [NettyClient-NIO-1] DEBUG c.t.c.c.e.DispatchingClientEndpoint - API REQUEST received [endpoint id: 0] APIRequestMessage [requestId: 87, endpointId: -1, sessionId: -1, method: POST, entityName: *DeviceSN2, characteristic: Unknown, target: ]

15:53:50.205 [ClientProcessor-1] WARN  c.t.c.client.things.VirtualThing - Unable to get property subscriptions.  null

15:53:50.205 [ClientProcessor-1] WARN  c.t.c.client.things.VirtualThing - Unable to get event subscriptions.  null

15:53:50.206 [NettyClient-NIO-1] DEBUG i.n.h.c.h.w.WebSocket08FrameEncoder - Encoding WebSocket Frame opCode=2 length=17

15:53:52.201 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:53:55.201 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:53:58.201 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:54:01.202 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:54:04.202 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:54:07.202 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:54:10.203 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:54:13.203 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

15:54:16.203 [Client-EndpointMonitor-1] DEBUG c.t.c.c.e.m.CommunicationEndpointMonitorTask - CommunicationEndpoint Monitor - checking for disconnected endpoints

3 REPLIES 3
mikem1
5-Regular Member
(To:VladimirRosu)

Hi Vladimir,

After the SDK connects, it makes a request to the platform to retrieve information about the remote properties that are defined on its associated RemoteThing.  In your case that call is returning an error.  Are you adding your properties using the defineProperty method?  If so, how are you adding the properties to your RemoteThing on the platform?  Are they preconfigured there?  If none exist you'll get this error.

Hi Mike!

So, the properties are indeed defined via defineProperty (and I also changed the super.initializeFromAnnotations to super.initialize() ).

After I run the EMS, I see unbound things in the platform, I create a remote Thing and bind it to one of the identifiers, go to properties, manage bindings / remote and I see the properties there.

I click on Add All Above Properties, click Done.

Then, even if I restart the EMS, the properties don't get pushed.

Must be something I'm doing wrong, but I don't know exactly what.

If somebody has a running example with properties defined fir defineProperty and PUSH-mode working, I'd be incredible happy to see it

As it seems with the things which don't work in most of my cases, it was a mistake I did when I cleaned up the VirtualThing implemented class....

In the constructor I used super(name,description) while it should have been super(name,description,identifier,client);

Or of course to do super.setClient(client)

Thanks anyway everybody!

Have a good day!

Top Tags