Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2005-03-04
8
Medium Priority
?
1,418 Views
Last Modified: 2012-08-14
Hi,

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.


0
Comment
Question by:ckl_88
  • 3
  • 3
6 Comments
 
LVL 1

Expert Comment

by:kerzner
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.

0
 

Author Comment

by:ckl_88
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?

Thanks.
0
 
LVL 1

Expert Comment

by:kerzner
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.
0
Independent Software Vendors: 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

by:ckl_88
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?




0
 
LVL 1

Accepted Solution

by:
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.
0
 

Author Comment

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

0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

575 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