JMS over Internet... what product should I use?

Posted on 2005-03-04
Medium Priority
Last Modified: 2012-08-14

I'm currently thinking of a project that I will eventually write in the Java programming language. The concept for this project is simple. Basically, I have consumer who wants to request a quote (via an applet) for an automobile. This request goes to a server which then forwards this request to all the brokers who will then provide a quote. The server picks the lowest quote and sends this information back to the consumer... the applet will play a sound notifying the user of a response. All of these actions are over the internet and since the response may vary, the applet will not wait for a response, but be notified by the server when there is a response.

My requirements are:

1. Open source software. In other words, tools that I don't need to buy.
2. Need to use Java Messaging System or some other MOM.
3. Tomcat, OpenJMS.
3. Can work through firewalls.

I googled around and found that JMS isn't really recommended over the internet because some firewalls restrict access only through HTTP/HTTPS. I guess JMS communicates using other ports besides HTTP/HTTPS. Then I found JProxy which provides J2EE functionality on the client and also HTTP tunnelling. THis would be the perfect solution to my problem but it costs money....

Is there another product like JProxy that provides client-side J2EE functionality (for JMS) and http tunnelling that is FREE or open-source?

Thanks in advance.

Question by:ckl_88
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 13473593
I have recently worked out a solution with JBoss and JMS over internet. It was hard to configure (firewalls, and JBoss  JMS over Internet was), but I have it all working now. First pointer is my other question (where I did provide the answer also), http://experts-exchange.com/Programming/Q_21334984.html.


Author Comment

ID: 13489329
Well, I tried out tomcat and OpenJMS on a local machine using a simple chat program and it worked.

However, when I tried to setup tomcat and OpenJMS on my home computer and run the chat program on my work computer, it seems the JMS server is having a problem contacting the client. Seems like it is NAT related:

HC=Home Computer (Tomcat + OpenJMS) (internal IP = 192.168.219.x)
WC=Work Computer (Simple Chat program running in DOS) (internal IP = 192.169.1.x)
Router = both have NAT

WC <-> Router <-> Internet <-> Router <-> HC

The chat program subscribes and publishes to the same topic. The chat program starts up fine, it is when I type something in and press return that the server throws an exception. I checked the exception in the log file and apparently, the server it trying to connect to the client computer using it's internal IP. Of course, this won't work because they are on different Local Area Networks.

How in the world do I fix this?


Expert Comment

ID: 13489731
you are exactly right, these ar the kinds of problems you should have.

First, configure JBoss (or OpenJMS) to give you the right JNDI refrence (by default it may not be).

Then, put the server outside the firewall. I could not make it work when the server, too, was within.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 13489920
Thanks for quick reply kerzner,

I didn't quite understand your last post regarding the JNDI reference because I'm still new to all this. :-(

Just to clarify.
In the chat program, the client subscribes and publishes to the same topic. Thus, when I type "testng" it will publish this message and since it is also subscribed, the server will send this message back to the client (and all other clients that are subscribed the same topic). I monitored this activity using Hermes and confirmed that the server got the message "testing". I also confirmed that the server *tried* to send a notification back to the client, by examining the exception that was thrown. All I can deduce from the exception is that the server got the Internal IP address of the client (the IP address that is assigned by the NAT).... not the external one that is assigned by the ISP. Thus, when it tried to connect to 192.168.219.x:<someport>, it failed because this address doesn't exist on the Internet or the servers local lan.

Sorry to be so verbose...

I checked the openjms website and they actually say in their September 27, 2001 news release:
"We have also successfully configured OpenJMS to run across the internet with interposing firewalls and NATs between the client and the server"

I thought to myself, well, that's great, how do you do it? I looked for hours on their website for any type of source code beyond the simple ones they have, configuration settings, etc, but their examples and documentation seem to be extremely scarce... just enough to get you setup and running on the local machine using the provided examples.

So if they can do it, I should be able to do the same thing too right?


Accepted Solution

kerzner earned 200 total points
ID: 13490205
You are looking at the root of the problem, attempted connection to connect to 192.168.219.x:<someport>.

How does it know that? Because OpenJMS tells it - this is where you have to send the message.

So, if you put your server computer outside the firewall, you will be fine.

Or, you can try to find this setting in all the OpenJMS setup files, but it may not be easy. I could not do it with JBoss.

In fact, I suspect that JBoss finds out the ip by using a java.net call (getMyIp() kind of thing. If so, it is not configurable.

Author Comment

ID: 13490739
I will have to try what you suggested... Thanks. I will give an update as to whether it worked or not.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question