SignalK / signalk-server-java

DEPRECATED - see https://github.com/SignalK/signalk-java
Apache License 2.0
6 stars 9 forks source link

server does not publish uuid to 'self' property #29

Closed ph1l closed 7 years ago

ph1l commented 7 years ago

as specified here: https://github.com/SignalK/specification/blob/master/schemas/signalk.json#L12, a signalk server shoud publish the self propery containing the uuid of the vessel on which the server is running.

ph1l commented 7 years ago

Exception: More than one vessel present, and no self published...

rob42 commented 7 years ago

The current server publishes all data in the vessels.* subtree, so it will avoid self if its in the root. Not sure how it would do that in a delta. @tkurki ? It can easily be added to the full format but thats not often used....the value is available in the hello message, which was the first message sent on connection

{"self":"urn:mrn:signalk:uuid:6fb32f5b-7bd3-47a6-9e41-032a15faca55",
    "version":"v1.0.0",
     "timestamp":"2016-11-11T22:45:38.459Z"
}
tkurki commented 7 years ago

I think the main use case for this is being able to retrieve self id explicitly via http for whatever purposes one might need it.

Fixed this in Node server https://github.com/SignalK/signalk-server-node/issues/111

Not sure how it would do that in a delta.

Didn't get this - as I see it this is about full & http api, not delta.

ph1l commented 7 years ago

I think my problem here is that the java-server doesn't publish the self property in the rest api.

I start up and load the initial data from the REST API and then fire off a thread to do websocket delta processing. If my background websocket thread hasn't processed the hello message, which actually does require a self property, I am not guaranteed to have a self property, unless I block on seeing a hello message.

should my client block on a hello message? maybe.. to know the websocket is connected, ne?

tkurki commented 7 years ago

Well, I think that the spec says (a bit amibiguously maybe) that the rest api should provide self: http://signalk.org/specification/master/keys/#self

Here the appropriate action would be to add this functionality to the java server.

I think that with every move we should move towards more spec compliance and less towards workarounds for specific server implementation details.

And I am not saying that Node server is 100% compliant, just that this should be the general direction.

sumps commented 7 years ago

We have already added a Hello in iKommunicate Deltas when a socket is opened and will be adding the RestAPI self call as well but it is not implemented yet.

sumps commented 7 years ago

We agree that work arounds should be avoided and will do our best to get iKommunicate spec compliant ASAP

ph1l commented 7 years ago

Well, to be fair, the spec does not mark self as required. So, technically, this does not break compliance with the spec.

rob42 commented 7 years ago

I will add it to the REST API

rob42 commented 7 years ago

Added in JIT-DEPLOY-34