Re: Share info across different sessions servers

2013-07-03 Thread Jose María Zaragoza
Thanks Vince.
This could be an option.
The documentation is poor and I don't see many examples in the web

Could you send to  me some code as example  server.xml configuration ?

Regards





2013/7/3 Vince Stewart stewart.vi...@gmail.com

 I have am using tribes messaging to send messages between remote
 applications which include tomcat embedded. You construct your message and
 submit to a sendMessage process. All running apps are always listening
 for messages. They receive the message and then may or may not reply or
 broadcast as a result.


 On Wed, Jul 3, 2013 at 7:43 AM, Jose María Zaragoza demablo...@gmail.com
 wrote:

  Thanks Christopher :
 
  Maybe I explained myself badly
  I really need to send messages to a specific web session , not share data
 
  I need to pass some data ( message ) to a specific session from a remote
  system ( a remote process from a remote system).
  Finally, this data is passed to client's browser by AJAX Reverse
 
  My idea is the session creates a dynamic Queue and it configures itself
 as
  Consumer
  If I pass the Queue to remote process ( in message.replyTo() ) , the
 remote
  process can send data to that specific session
 
  I could use a RDBS but , in this case, session needs to create a thread
 to
  polling on a share table. And I don't like this idea, sorry.
 
  memcached sounds good but I don't know anything about it and I don't know
  is is based on a event-driven architecture
 
 
 
  I need
 
  1) send data/message from a remote process to a specific web session
  2) execute some code in this session
  3) consume ( a.k.a, delete ) that message
 
  Persistence is not a requirement but ActiveMQ allows it
 
  I'l try it with ActiveMQ
 
  Thanks again and regards
 
 
 
 
 
  2013/7/2 Christopher Schultz ch...@christopherschultz.net
 
   -BEGIN PGP SIGNED MESSAGE-
   Hash: SHA256
  
   Jose,
  
   On 7/2/13 3:22 AM, Jose María Zaragoza wrote:
Thanks I need to share formatted text data  ( XML, key/value,
...I'm not sure yet )
   
I don't understand your comment about JMS . I will use a JMS broker
as ActiveMQ . Probably it will be embebbed into the same JVM than
Tomcat server. ActiveMQ supports  persistent messages
  
   While JMS may work, it's really not the right solution. JMS is a
   messaging service, and you want a data-storage service.
  
I could use a database but I don't want to be making polling every
X seconds by a session
  
   You don't have to pull any data that the user doesn't need, do you?
  
   If you don't want to use a RDBMS, how about something like memcached?
   I asked about using memcached a while back on this list and got some
   other suggestions as well (as memcached doesn't make a great fail-safe
   shared-data storage system... it's really meant to be more of a cache
   of data available elsewhere).
  
   - -chris
   -BEGIN PGP SIGNATURE-
   Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
   Comment: GPGTools - http://gpgtools.org
   Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
  
   iQIcBAEBCAAGBQJR0ycOAAoJEBzwKT+lPKRYaAsP+wfhqoLQWwJoYLpur0Z5VOeJ
   GUmylaW+kllpcbdFdVG81691rjUW1Ph5yQ2MQzPFKv0bCp2cyHMWQuJgAp1rq/Lo
   T6Bpba6IHeyucxEAk0XZfGu4efS+wc39ncq9C3GPamEvrN+locYGtM/lqSpkSxKz
   5ADXD9o2//U5Nk00N0KHPH4xsp/wtx0NJgT1p9f1VUKgU9pVvGFhHvrozvdAEcnv
   9U7IQroNO7uR3RnKL/rq9CH3MsxL/gbWCWEZ21WkaguLFysc67naaSQvimIoLok9
   eUfCK6Z5Bll4VeefK6YlA6E49sj01NZD1zuj0J/DGUiwBuFiNSZc1Z2NOZlue7Oo
   efpaRkjINouIfyk3RONa8/ZuNWf80ImX5vvJKEYK7ujc2LB7G8+ID95Toeej0eyg
   cZWHZo3N67nYgker4Kp4xn4VXBs4QfDzY/uOfsUyp8voNcCz6lBo38w8T3jvVJzV
   ci18cbWdRXQ3NrlaBkI8qJeEzMWAegM7C1IqJUspmlDHvsUIiamGA+ZF6nBNPr16
   w3lx8X8xWjGM63OQaoYMbTc2ZXFCkP0zkXXEcx49zyGMSEDSk2NySw2HkAOh9iVx
   tr7YCDChtFg8mBQPY6CiiasEtn8j9JMK/XawdDI34LTsO1molB5OvJDGo558BqMm
   3hK/JZGxPkEPapvOfWRM
   =tOMh
   -END PGP SIGNATURE-
  
   -
   To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
   For additional commands, e-mail: users-h...@tomcat.apache.org
  
  
 



 --
 Vince Stewart



Huge SendQ tomcat7 Websocket

2013-07-03 Thread hidayath
Hi,

 

A web application is using websockets. Opened the URL in a browser (Chrome
and FF). 

 

The sendQ is increasing constantly, though the browsers are closed.

 

Reproducibility: very low

Tomcat version: 7.0.30

 

cid:image001.png@01CE77EA.01324F50

 

 

Thanks and regards,

Hidayath

 

Saven Technologies: A leader in technology driven business solutions

---
#302, 3rd Floor, MyHome Sarovar Plaza, Hyderabad- 500 063, India
Off: +91 040 23237303/7304 ext 115 | Mobile: +919581177421  |
email: hidayath.basha mailto:hidayath.ba...@saventech.com @saventech.com
|   http://www.saventech.com/ www.saventech.com 

follow me:  http://twitter.com/hidayath26 http://twitter.com/hidayath26


---

 

 



websockets questions

2013-07-03 Thread André Warnier

Hi.

I am looking for general and not so general info about websockets.
I have read the Wikipedia article, RFC 6455, the websocket API doc on MSDN, and 
pretty
much all that I have been able to find on the WWW.
But I am still not sure if I have a full picture.

This is the context : we are currently developing an application in which a client 
(initially, a user with a browser) enters a search expression
and submits it to the server, for the server application to execute against a number of 
information providers (say Google Scholar, Pubmed and Amazon).

The application on the server then, connects in parallel to these information 
providers,
submits the search to each, and starts collecting results (list of articles or 
books
e.g.).  These results trickle in from the various sources, at different rates.
The client is impatient, so it would be of benefit to start showing results in the browser 
as soon as some are available (on the server), and keep updating his display after that 
with whatever arrives from each source, more or less as it arrives.

Typically, such an update from the server would be from 20 to 50 references 
(title,
authors, etc.), so basically text, probably sent to the browser in JSON format.

One classic way for us to implement this, would be by doing some kind of 
regular polling
from the browser side, to ask if there is any update available.
This is technically easy via AJAX techniques, but it requires quite a bit of 
machinery on
the server side (sessions, long-running processes to reconnect to etc.), and is 
not very
efficient.

We were thus thinking that this might be a good case for implementation through a 
websockets connection, even though the needs are not as real-time as a game or a 
chat-like application for instance.  And of course for our team of young developers, it 
would be rather attractive to be using some real cutting-edge technology..


However, from all my current perusing, it does seem to me that websockets is 
still not
really production-ready (I am not talking about the Tomcat implementation per 
se, but
more generally).  For example, I could find a discussion thread from back in 
March this
year (http://www.gossamer-threads.com/lists/apache/dev/423880), in which it 
seems that an
Apache httpd proxy module for websockets is just in its infancy at the moment.
There is also the fact that native websockets capability in IE is only 
available since
IE-10, and that solutions which allow this to work in lower IE versions are a bit 
iffy
(relying on a diversion through Adobe's FlashPlayer e.g.).
(Most of our customers are largish corporations, which are not going to update 
their
browsers, nor open special ports in their firewalls, just to please us).

So, in short - so to speak - does anyone have comments to contribute about this 
?

Thanks
André




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: websockets questions

2013-07-03 Thread Jess Holle

Unfortunately I don't have any information -- just related questions.

1. For someone currently using Apache httpd+mod_jk to load balance
   requests, what does one do about load balancing WebSockets requests
   between Tomcat instances?
 * As Andre alluded to, the only mention of websocket handling in
   Apache httpd really appears to be in its infancy.
 * It would kind of seem like mod_jk should be expanded to deal
   with WebSockets...
 * In any case, there would still be questions as to how this
   interacts with mod_jk within the same web app.
2. Any other browser considerations beyond requiring IE 10+? Are
   relatively recent Chrome, Firefox, and Safari WebSocket ready?
3. How well do WebSockets play with existing network infrastructure?
 * IP load balancers
 * HTTP(S) forward and reverse proxy servers
 * Timeouts (idle, response, etc...)

   In general, if WebSockets don't just get along with existing
   network infrastructure in this regard but rather place requirements
   and restrictions upon it to function properly, then it will be a
   while before those of us who need to deploy a single solution into
   many disparate environments can leverage WebSockets in any
   substantive fashion.

--
Jess Holle



Re: Share info across different sessions servers

2013-07-03 Thread Vince Stewart
Hi Jose,

a couple of things,
1) I use embedded Tomcat to build my application and this has allowed me to
maintain 2 single-line patches in tribes classes by adding tribes source
code to my compilations. However those patches are only necessary with
large messages that take more than 3 seconds to be transmitted from the
transmitting machine to the Internet Service Provider machine (approx 0.5
meg for my system). There is a config setting (Sender/Transport/timeout)
that's supposed to alter this 3 second timeout limit but I'm not sure it
works.
2) The implementation is not at all trivial. You have to register
StaticMember objects because usual member discovery does not work over
wide-area network (WAN). I allocate one machine as SuperServer and all
other machines have to enroll with SuperServer at startup. All machines
need to have a unique combination of Ipv4 address and port number (which
might represent a redirection port for use by the router whereupon
networked machines also need LAN addresses set). Once registration is
complete, all sub-Server machines can send/receive SuperServer and vice
versa.

There is a tutorial on-line which is adequate but not for WAN. I think you
have at least two weeks of work in front of you using tribes but I am very
happy I used this method.
None of my code would add much (except confusion) to that in the tutorial.
Make sure you start without multicast enabled as it currently is suitable
only for LAN.

 ///Class Constructor
 public ServerMessaging() throws SocketException{
 this.myChannel=new GroupChannel();
 ChannelListener msgListener = new ServerMessaging.MyMessageListener();
 MembershipListener mbrListener = new ServerMessaging.MyMemberListener();
 myChannel.addMembershipListener(mbrListener);
 myChannel.addChannelListener(msgListener);
  try{

myChannel.start(Channel.MBR_TX_SEQ|Channel.MBR_RX_SEQ|Channel.SND_TX_SEQ|Channel.SND_RX_SEQ);//no
multicast
  }
  catch(ChannelException e){
  U.log(e);
  }
 }

public void detectOrderNumber_EnrollWithSuperServer() throws
ChannelException{
setMyServerOrderStatus(); // machine reads its mac address or some file;
then from a table will set serverOrderNumber to 0 for superserver ; others
1,2,3...
 if(this.getServerOrderNumber()==0){  meaning this is the superserver
 someObject.doSomeThingMaybe();
 }
 else{
 this.sendAckRequiredMessage(0,Enrollment); /// first argument specifies
SuperServer, member 0 (a table will need to be provided to hold IPv4
address and port for each member)
 }
}


Re: Share info across different sessions servers

2013-07-03 Thread mailingl...@j-b-s.de
Hi!

what about treating this problem as a chat system? You want to broadcast 
messages, right? Maybe http://cometd.org/
is of any help (did not use it now personally)

Jens

Sent from my iPhone

On 04.07.2013, at 00:14, Vince Stewart stewart.vi...@gmail.com wrote:

 Hi Jose,
 
 a couple of things,
 1) I use embedded Tomcat to build my application and this has allowed me to
 maintain 2 single-line patches in tribes classes by adding tribes source
 code to my compilations. However those patches are only necessary with
 large messages that take more than 3 seconds to be transmitted from the
 transmitting machine to the Internet Service Provider machine (approx 0.5
 meg for my system). There is a config setting (Sender/Transport/timeout)
 that's supposed to alter this 3 second timeout limit but I'm not sure it
 works.
 2) The implementation is not at all trivial. You have to register
 StaticMember objects because usual member discovery does not work over
 wide-area network (WAN). I allocate one machine as SuperServer and all
 other machines have to enroll with SuperServer at startup. All machines
 need to have a unique combination of Ipv4 address and port number (which
 might represent a redirection port for use by the router whereupon
 networked machines also need LAN addresses set). Once registration is
 complete, all sub-Server machines can send/receive SuperServer and vice
 versa.
 
 There is a tutorial on-line which is adequate but not for WAN. I think you
 have at least two weeks of work in front of you using tribes but I am very
 happy I used this method.
 None of my code would add much (except confusion) to that in the tutorial.
 Make sure you start without multicast enabled as it currently is suitable
 only for LAN.
 
 ///Class Constructor
 public ServerMessaging() throws SocketException{
 this.myChannel=new GroupChannel();
 ChannelListener msgListener = new ServerMessaging.MyMessageListener();
 MembershipListener mbrListener = new ServerMessaging.MyMemberListener();
 myChannel.addMembershipListener(mbrListener);
 myChannel.addChannelListener(msgListener);
  try{
 
 myChannel.start(Channel.MBR_TX_SEQ|Channel.MBR_RX_SEQ|Channel.SND_TX_SEQ|Channel.SND_RX_SEQ);//no
 multicast
  }
  catch(ChannelException e){
  U.log(e);
  }
 }
 
 public void detectOrderNumber_EnrollWithSuperServer() throws
 ChannelException{
 setMyServerOrderStatus(); // machine reads its mac address or some file;
 then from a table will set serverOrderNumber to 0 for superserver ; others
 1,2,3...
 if(this.getServerOrderNumber()==0){  meaning this is the superserver
 someObject.doSomeThingMaybe();
 }
 else{
 this.sendAckRequiredMessage(0,Enrollment); /// first argument specifies
 SuperServer, member 0 (a table will need to be provided to hold IPv4
 address and port for each member)
 }
 }

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org