I want to host a service using JMS and send data to a client in json and xml format. How can we send data to a client in json and xml format?
JMS is an interface specification, not a transport. You need to look to the specific implementation to understand that question.
I have used ActiveMQ to transport JSON and XML data to other clients; we used a header flagging the content type, and found that quite effective. Native Java, Ruby, and Perl libraries were used to communicate with ActiveMQ (via STOMP, or OpenWire).
I have also experimented with RabbitMQ, again over STOMP, and with using Apache Camel in conjunction with ActiveMQ to provide an HTTP interface to the queue, automatically bridging JSON posted via HTTP to a JMS consumer - and serving back a JSON response to the request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With