Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a WebSocket for SnapShot as JSON #31

Open
dukescript opened this issue Feb 18, 2016 · 2 comments
Open

Need a WebSocket for SnapShot as JSON #31

dukescript opened this issue Feb 18, 2016 · 2 comments

Comments

@dukescript
Copy link

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.

@AdamBien
Copy link
Owner

Hi Dukescript,

I could deliver you the snapshot without Moxy. You only need the Snapshot class as JSON?

thanks and cheers,

adam

@dukescript
Copy link
Author

#35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants