What is the benefit of sending xml using jms

In the current project, we are sending xml as textmessage using jms. I don’t understand why they don’t just send Objectmessage, why the xml processing overhead?

so the question basically boils down to why use xml in jms?

0
source share
2 answers

It all comes down to a design solution in the format of message serialization.

Objectmessage will prove to be the most effective mechanism first. However, this will not work in the following scenarios:

  • Validation of messages (XML schemas act as a form of a contract with a message)
  • Differences in software versions between sender and receiver (Message versioning)
  • Communication with non-Java systems

Serializing the message in XML does not completely solve these problems, but the message form for user-readable formats allows debugging.

Finally, XML is not the only game in the city. JSON is becoming popular as an alternative to XML. Protocol Buffers is Google’s messaging protocol and provides a good overview of some of Google’s problems and solutions.

+6
source

The main advantage of using XML in this situation is that you remove the dependency on having the same software stack at both ends of the link.

I came across a client who was exchanging data with a key provider, creating a daily image of his SQL server database at one end and restoring it at the other. Consequences: Neither side could upgrade to the new SQL Server unless the other side upgraded on the same day.

In addition, as O'Connor mentioned, XML makes it relatively painless to expand the content of a message when requirements change, without having to make the change at the same time.

+2
source

All Articles