Hi James,

That's an interesting statement that using an open source project gives you less control and more cost than home-grown project, althought it might depend on the responsiveness and openness of the project community. If you are interested in XMPP, I'd recommend the following XMPP servers, which are both based on MINA:

 * OpenFire
 * Apache Labs Vysper

Vysper might be more interesting to you in terms of licensing.

If not interested in XMPP... then here's my idea about your question:

If your business logic can be executed simultaneously, choose the first approach. If the business logic should be executed one by one per connection, then choose the second approach.

On Wed, 28 May 2008 16:45:35 +0900, James Ling <[EMAIL PROTECTED]> wrote:

Hi Gato,
Thank you very much for your kindly reply.I cannot use Open Fire for some reason,for which it doesn't meet our business logic very exactly and we need a server that was fully controlled by ourselves,basing on Open Fire which will raise our development and maintainence costs too.So I still need to know the answers to the question I mentioned in my original mail. BTW I cannot understand what you said 'By no means I'm trying to "steal" you from MINA ' very well :(.
Best Wishes


----- Original Message -----
From: "Gaston Dombiak" <[EMAIL PROTECTED]>
To: "dev" <[email protected]>
Sent: Wednesday, May 28, 2008 1:47 PM
Subject: Re: A question about my app's performance


Hey James,

By no means I'm trying to "steal" you from MINA :) but have you checked Openfire ( http://www.igniterealtime.org/projects/openfire/index.jsp ). Openfire is an XMPP (aka Jabber) server built on top of MINA. XMPP is the open standard for IM.

Regards,

  -- Gato


On 5/27/08 10:11 PM, "James Ling" <[EMAIL PROTECTED]> wrote:

Hi folks,We have built our IM server based on MINA.It's excellent!Thanks for you guys' hard work!I have a question to ask,thanks in advance!
snippet codes as followed:
public class TcpHandler extends IoHandlerAdapter
{
private static final Logger logger = LoggerFactory.getLogger(TcpHandler.class);
    @Inject
    private ITaskProcessor taskProcessor;
    @Inject
    private ISessionManager sessionManager;
    @Inject
    IHarvestServerContext context;

    public void sessionCreated(IoSession session)
    {}

    public void sessionClosed(IoSession session)
    {}

    public void sessionIdle(IoSession session, IdleStatus status)
    {}

    public void exceptionCaught(IoSession session, Throwable cause)
    {
        session.close();
    }

    /*
     * receive any incoming complete packets
     *
* @see org.apache.mina.common.IoHandler#messageReceived(org.apache.mina.common.IoSession,
     *      java.lang.Object)
     */
    public void messageReceived(IoSession session, Object message)
    {
/*question is here,when messages have been received,I want to do our business logic in two different ways,but I dunno how to profile them to see which one's performance is better.*/ 1 put message into a array,then a multithread business logic processor keeping getting one from the array to do business logic.Then after the processing,if there are messages that need to be sent-back or broadcasted to clients ,add them into another array then still a multithread messages sender keeping getting one from the array to send it to client. 2 just do business here.Then after the processing,if there are messages that need to be sent-back or broadcasted to clients ,just send them
    }
}
TKS a lot!




--
Trustin Lee - Principal Software Engineer, JBoss, Red Hat
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Reply via email to