aspose file tools*
The moose likes Servlets and the fly likes client callback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "client callback" Watch "client callback" New topic
Author

client callback

shikhar singh
Greenhorn

Joined: Jan 25, 2001
Posts: 11
Hi
I am planing to develop a messaging module where with in the organization (also across the firewall), employees will be able to send messages to each other. These messages will be stored in the DB and the user will be notified with the message that 'new message is arrived'.
To achive this server will need to make the callback to the client.
I was planning to use the JMS which will asynchronously log the messages in the DB and will notify the respective user(s).
Problem I am facing is with notifying the client which can be a browser instance across the firewall on web.
Following are few alternatives which I looked into:
1.Applets: I have read that applet does not help across the firewalls.
2.Polling: This will cause unneccasry network traffic.
3. Holding the client connection: This can become scalability issue.
Is there any clean way to achieve this.
Any help will be apreciated
Thanks in advance
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Since the browser has to initiate a request/response cycle, you have to have some process on the client side - ie polling by something.
Applet - can do a query across a firewall as long as it uses HTTP and addresses the URL the applet was loaded from. (or you can use a signed applet which can address another URL.)
Javascript - can also do polling.
Long term connection - not a good idea unless the rate of new messages is high.
Bill
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
shikharsingh,
Javaranch has a naming policy which is strictly enforced. Please review the policy and change your display name if you wish to keep posting here. Thanks.


Matthew Phillips
shikhar singh
Greenhorn

Joined: Jan 25, 2001
Posts: 11
Hi William,
Thanks for the reply,
As you said polling by javascript or applet will do this but this will not be instant/immediate state update of client. Moreover this might take more network resourses.
Holding the connection as you said is also not a clean solution.
Because the problem still persists, let me rephrase my question:
Is there any way by which server can identify the client(browser) across the firewall and make instant callback, at certain condition?
(except Holding connection)
Thanks in advance
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
Short form answer = "not with a browser"
HTTP is just not designed that way.
You could have long duration socket connections through another port, but of course this may cause problems with firewalls.
I suppose you could have an applet listening at port 80 just as if it was a web server but your firewall would have to be configured to pass incoming attempts to connect....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: client callback