Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B27110B5A for ; Wed, 3 Jul 2013 22:15:09 +0000 (UTC) Received: (qmail 58922 invoked by uid 500); 3 Jul 2013 22:15:06 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 58809 invoked by uid 500); 3 Jul 2013 22:15:05 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 58800 invoked by uid 99); 3 Jul 2013 22:15:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 22:15:05 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of stewart.vince@gmail.com designates 209.85.128.48 as permitted sender) Received: from [209.85.128.48] (HELO mail-qe0-f48.google.com) (209.85.128.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2013 22:14:59 +0000 Received: by mail-qe0-f48.google.com with SMTP id 2so416782qea.21 for ; Wed, 03 Jul 2013 15:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ow9do1A2U2+YE6B0ni5N1IR7zKq5RkMI2ImRzK8L9oA=; b=znCsgeW6vad97oCbKyeiWvPsrbdmssBKkTsRht6xeIZHcVWsQmRLSL/FUz2RkhwpNe x7ZDjo6rtqydMBvO9SWpgzP8PQ/YtVRG4ZlTiE89G8QM6gBqtv5E66E5agVHDuLSk2xK CbcuAd6EN3zC98zt12LrnrB7fixonUBQMp/wskPfDp0OFtYGr1oCjN76SYW1qDhJh/JR goq3ddMVJlALIJGyzHixy+8LwW8ZRR8Kh8DrXbM1pB4EYVVw5CqYS6zqoEi+HVrPj63k 5HI3+iibUfcihTbtwTyiFnxpyDUybEx8a1mxskOsiHJw555Qx+smEQwHLEkIx81N/Kfl IB1g== MIME-Version: 1.0 X-Received: by 10.49.30.104 with SMTP id r8mr3813542qeh.27.1372889678356; Wed, 03 Jul 2013 15:14:38 -0700 (PDT) Received: by 10.49.106.8 with HTTP; Wed, 3 Jul 2013 15:14:38 -0700 (PDT) In-Reply-To: References: <42B9B997-E1EF-4C24-A3A1-48A4D704ABB5@j-b-s.de> <51D3270F.8090906@christopherschultz.net> Date: Thu, 4 Jul 2013 10:14:38 +1200 Message-ID: Subject: Re: Share info across different sessions & servers From: Vince Stewart To: Tomcat Users List Content-Type: multipart/alternative; boundary=047d7bea4484982a3704e0a2c9f0 X-Virus-Checked: Checked by ClamAV on apache.org --047d7bea4484982a3704e0a2c9f0 Content-Type: text/plain; charset=ISO-8859-1 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) } } --047d7bea4484982a3704e0a2c9f0--