Posts Tagged ‘java’

SOAP over JMS…..Not

13 April 2008

I largely work with people with a java background (I have a Microsoft background) so often have to map java terms into something that I understand. Our SOA architecture uses MQ Series as the transport layer for our SOAP messages as apposed to HTTP. The java guys commonly use the term ‘SOAP over JMS’ which left me confused, I understood that JMS is the Java Message Service but wondered why we would use a technology depended transport layer.

Yes I did eventually figure out that the term ‘SOAP over JMS’ is an incorrect description, JMS is a Message Queue API much like System.Messaging is an API in .Net. The term should be ‘SOAP or MQ Series’.

JMS looks something like (copied from Linda’s blog):


ConnectionFactory cf= new com.sun.messaging.ConnectionFactory();
Connection connection = cf.createConnection();
Session session = connection.createSession();
Destination destination = session.createQueue("HelloWorld");
MessageProducer producer = session.createProducer(destination);
connection.start();

TextMessage message = session.createTextMessage();
message.setText("Hello World");
producer.send(message);

In .Net it would look like:

MessageQueue msgQ = new MessageQueue(@".\private$\HelloWorld");
msgQ.Send("Hello World");
msgQ.Close();

I am not sure if the JMS example could be simplified, as indicated above a copied the example.

So if you year the term SOAP over JMS you know know what is actually meant.

Advertisements