tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <demablo...@gmail.com>
Subject Re: Share info across different sessions & servers
Date Thu, 04 Jul 2013 06:57:12 GMT
Thanks Vince.
I'll take a look , but , it doesn't look trivial , not at all

Regards


2013/7/4 Vince Stewart <stewart.vince@gmail.com>

> 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)
>  }
> }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message