• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

client callback

 
shikhar singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shikhar singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic