I'm creating a Client using DukeScript. I can connect to the Socket that sends the most current Snapshot (ws://localhost:8080/lightfish/snapshots/).Unfortunately it returns XML (I need JSON).
In order to test and develop, I added a dependency on moxy 2.6, created a jaxb.conf and changed the Serializer to create JSON:
After that I can consume the messages without problems, but obviously this change breaks other clients. For my experiments that's no problem, but it would be nice to have a WebSocket that sends Snapshots as JSON, so I can contribute my Client.
This is a RFE.
I'm creating a Client using DukeScript. I can connect to the Socket that sends the most current Snapshot (ws://localhost:8080/lightfish/snapshots/).Unfortunately it returns XML (I need JSON).
In order to test and develop, I added a dependency on moxy 2.6, created a jaxb.conf and changed the Serializer to create JSON:
org.lightfish.business.heartbeat.control.Serializer:
@PostConstruct public void initialize(){ try { JAXBContext jaxb = JAXBContext.newInstance(Snapshot.class,Escalations.class,Escalation.class); this.marshaller = jaxb.createMarshaller(); this.marshaller.setProperty("eclipselink.media-type", "application/json"); } catch (JAXBException ex) { throw new IllegalStateException("Cannot initialize JAXB context " + ex); } }
After that I can consume the messages without problems, but obviously this change breaks other clients. For my experiments that's no problem, but it would be nice to have a WebSocket that sends Snapshots as JSON, so I can contribute my Client.