1
votes

We'll start with a down-to-earth example and then return the coneptual question.

I am using Weblogic (10.3) as my Application Server. I want my application to have JMS capabilities and decided to let it use the Weblogic as the JMS / MOM provide. I setup a Queue in Weblogic and created an MDB class in my code.

Now I want to send a message to Weblgic queue. I used openJMS client. It required me to include the weblogic jar file in its classpath in order to send a message to weblogic.

And the same when I setup Weblogic to send message to the openJMS queue - I used Foreign Destination - it threw class not found exception until I placed openJMS jars in weblogic classpath.

This is becasue all JMS communication examples I saw use JNDI context to get the connection factory.

My question is: does that make sense? Isn't JMS suppose to be some neutral communication protocol? Meaning I can't decide to which JMS provider I am sending, at run-time, because I won't have its context classes in my classpath?

Or did I simply miss something in the setup?

Is there another way to preapre the connection factory to the remote provider?

1

1 Answers

1
votes

Isn't JMS suppose to be some neutral communication protocol?

Good question. The answer is: it isn't. JMS is only the API that defines how to connect and send messages to queues/topics. It is not a protocol, so JMS provider implementations are free to use their own internal message format — that's why you need to import the jars of the provider. And also you can't expect provider A to be able to exchange messages with provider B, unless both providers give such possibility explicitly.

An open, cross platform messaging communication protocol is AMQP. There are also other commercial solutions, for example IBM Websphere MQ.