You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Vijay K Pandey <VP...@mdes.ms.gov> on 2010/04/20 18:23:06 UTC

changes from Mina 2.0.0-M3 to 2.0.0-M6 to 2.0.0-RC1

Hi,

I have an application which has a very simple scenario of sending Java POJO(serializable) objects from Mina client to server and client waits for the response.

It was all working very fine with mina-core-2.0.0-M3.jar but looks like something has changed in  mina-core-2.0.0-M6.jar and mina-core-2.0.0-RC1.jar where on several messages mina server receives the message from client ( both process running on same machine) after a delay of 5 seconds. I can see that on client side LoggingFilter has written the message but then there is a delay on server side when it is received.

I ran  the test on the same "dataset" for the above 3 versions of MINA and - M3 runs fine without any issue and there is no delay. I am testing this in a controlled environment where at any given point of time only 1 message is sent. Only after the response is received, does the second message is sent out.

Message is basically  - an array List - have 3 members where2 members are of string type and  1 member is HashMap of around 12 objects(11 are simple primitive wrappers and 1 POJO - having 6 primitives wrappers)

Can someone point me to the right direction?

Thanks
Vijay

-----------------Mina client code snippet ------------
            connector.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
            connector.getFilterChain().addLast( "logger",new LoggingFilter() );
            connector.setConnectTimeoutMillis(30 * 1000);

            ConnectFuture future1 = connector.connect( address );
            future1.awaitUninterruptibly(15, TimeUnit.SECONDS);
            if (!future1.isConnected()) {
                  return false;
            }
            session = future1.getSession();

            CloseFuture closeFuture = session.getCloseFuture();
            closeFuture.addListener((IoFutureListener<?>) new IoFutureListener<IoFuture>() {
                public void operationComplete(IoFuture future) {
                    System.out.println("The session is now closed");
                    logger.info("Mina client session is getting closed");
                }
            });

---------------------------------------Mina Server Code snippet ---------------------------------------------------------
        acceptor = new NioSocketAcceptor();

        acceptor.getFilterChain().addLast( "logger",
                                           new LoggingFilter() );
        acceptor.getFilterChain().addLast( "codec",
                                           new ProtocolCodecFilter( new ObjectSerializationCodecFactory() ) );

        acceptor.setHandler( handler );
        acceptor.getSessionConfig().setReadBufferSize( 2048 );
        acceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE,
                                                 3 );

        acceptor.bind( new InetSocketAddress( "127.0.0.1", port ) );





HelloWorldHttpService implements HttpService

Posted by Pradeep chahal <de...@live.com>.
Hello,

 

there few example in asyncWeb and does not have a main function, I dont how to run these example which ahd implemented HttpService from eclipse.

 

 


 
> Date: Wed, 21 Apr 2010 18:10:20 +0530
> Subject: Re: changes from Mina 2.0.0-M3 to 2.0.0-M6 to 2.0.0-RC1
> From: paliwalashish@gmail.com
> To: users@mina.apache.org
> 
> The best way would be to take Thread dumps and see what's going on inside.
> Using a logging filter could tell you a little more when things have
> been processed...
> 
> thanks
> ashish
> 
> On Tue, Apr 20, 2010 at 9:53 PM, Vijay K Pandey <VP...@mdes.ms.gov> wrote:
> > Hi,
> >
> > I have an application which has a very simple scenario of sending Java POJO(serializable) objects from Mina client to server and client waits for the response.
> >
> > It was all working very fine with mina-core-2.0.0-M3.jar but looks like something has changed in ámina-core-2.0.0-M6.jar and mina-core-2.0.0-RC1.jar where on several messages mina server receives the message from client ( both process running on same machine) after a delay of 5 seconds. I can see that on client side LoggingFilter has written the message but then there is a delay on server side when it is received.
> >
> > I ran áthe test on the same "dataset" for the above 3 versions of MINA and - M3 runs fine without any issue and there is no delay. I am testing this in a controlled environment where at any given point of time only 1 message is sent. Only after the response is received, does the second message is sent out.
> >
> > Message is basically á- an array List - have 3 members where2 members are of string type and á1 member is HashMap of around 12 objects(11 are simple primitive wrappers and 1 POJO - having 6 primitives wrappers)
> >
> > Can someone point me to the right direction?
> >
> > Thanks
> > Vijay
> >
> > -----------------Mina client code snippet ------------
> > á á á á á áconnector.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
> > á á á á á áconnector.getFilterChain().addLast( "logger",new LoggingFilter() );
> > á á á á á áconnector.setConnectTimeoutMillis(30 * 1000);
> >
> > á á á á á áConnectFuture future1 = connector.connect( address );
> > á á á á á áfuture1.awaitUninterruptibly(15, TimeUnit.SECONDS);
> > á á á á á áif (!future1.isConnected()) {
> > á á á á á á á á áreturn false;
> > á á á á á á}
> > á á á á á ásession = future1.getSession();
> >
> > á á á á á áCloseFuture closeFuture = session.getCloseFuture();
> > á á á á á ácloseFuture.addListener((IoFutureListener<?>) new IoFutureListener<IoFuture>() {
> > á á á á á á á ápublic void operationComplete(IoFuture future) {
> > á á á á á á á á á áSystem.out.println("The session is now closed");
> > á á á á á á á á á álogger.info("Mina client session is getting closed");
> > á á á á á á á á}
> > á á á á á á});
> >
> > ---------------------------------------Mina Server Code snippet ---------------------------------------------------------
> > á á á áacceptor = new NioSocketAcceptor();
> >
> > á á á áacceptor.getFilterChain().addLast( "logger",
> > á á á á á á á á á á á á á á á á á á á á á new LoggingFilter() );
> > á á á áacceptor.getFilterChain().addLast( "codec",
> > á á á á á á á á á á á á á á á á á á á á á new ProtocolCodecFilter( new ObjectSerializationCodecFactory() ) );
> >
> > á á á áacceptor.setHandler( handler );
> > á á á áacceptor.getSessionConfig().setReadBufferSize( 2048 );
> > á á á áacceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE,
> > á á á á á á á á á á á á á á á á á á á á á á á á 3 );
> >
> > á á á áacceptor.bind( new InetSocketAddress( "127.0.0.1", port ) );
 		 	   		  
_________________________________________________________________
Bollywood This Decade
http://entertainment.in.msn.com/bollywoodthisdecade/

RE: changes from Mina 2.0.0-M3 to 2.0.0-M6 to 2.0.0-RC1

Posted by Vijay K Pandey <VP...@mdes.ms.gov>.
On taking the thread dump for different versions -  this is the extra thread(locking monitors) which I receive in 2.0.0-M6 and 2.0.0.-RC1 --- I am running JDK6 _20 64 bit on windows.

"NioProcessor-1" prio=6 tid=0x0000000067ece000 nid=0x18b4 runnable [0x000000006c9cf000]
   java.lang.Thread.State: RUNNABLE
        at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method)
        at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(WindowsSelectorImpl.java:273)
        at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(WindowsSelectorImpl.java:255)
        at sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:136)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
        - locked <0x0000000063f01b50> (a sun.nio.ch.Util$1)
        - locked <0x0000000063f01b38> (a java.util.Collections$UnmodifiableSet)
        - locked <0x0000000063f01700> (a sun.nio.ch.WindowsSelectorImpl)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at org.apache.mina.transport.socket.nio.NioProcessor.select(NioProcessor.java:69)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:961)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
        - <0x0000000063f010c8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)

Does it give any pointers that where I should be looking for?

Thanks
Vijay
-----Original Message-----
From: Ashish [mailto:paliwalashish@gmail.com]
Sent: Wednesday, April 21, 2010 7:40 AM
To: users@mina.apache.org
Subject: Re: changes from Mina 2.0.0-M3 to 2.0.0-M6 to 2.0.0-RC1

The best way would be to take Thread dumps and see what's going on inside.
Using a logging filter could tell you a little more when things have
been processed...

thanks
ashish

On Tue, Apr 20, 2010 at 9:53 PM, Vijay K Pandey <VP...@mdes.ms.gov> wrote:
> Hi,
>
> I have an application which has a very simple scenario of sending Java POJO(serializable) objects from Mina client to server and client waits for the response.
>
> It was all working very fine with mina-core-2.0.0-M3.jar but looks like something has changed in  mina-core-2.0.0-M6.jar and mina-core-2.0.0-RC1.jar where on several messages mina server receives the message from client ( both process running on same machine) after a delay of 5 seconds. I can see that on client side LoggingFilter has written the message but then there is a delay on server side when it is received.
>
> I ran  the test on the same "dataset" for the above 3 versions of MINA and - M3 runs fine without any issue and there is no delay. I am testing this in a controlled environment where at any given point of time only 1 message is sent. Only after the response is received, does the second message is sent out.
>
> Message is basically  - an array List - have 3 members where2 members are of string type and  1 member is HashMap of around 12 objects(11 are simple primitive wrappers and 1 POJO - having 6 primitives wrappers)
>
> Can someone point me to the right direction?
>
> Thanks
> Vijay
>
> -----------------Mina client code snippet ------------
>            connector.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
>            connector.getFilterChain().addLast( "logger",new LoggingFilter() );
>            connector.setConnectTimeoutMillis(30 * 1000);
>
>            ConnectFuture future1 = connector.connect( address );
>            future1.awaitUninterruptibly(15, TimeUnit.SECONDS);
>            if (!future1.isConnected()) {
>                  return false;
>            }
>            session = future1.getSession();
>
>            CloseFuture closeFuture = session.getCloseFuture();
>            closeFuture.addListener((IoFutureListener<?>) new IoFutureListener<IoFuture>() {
>                public void operationComplete(IoFuture future) {
>                    System.out.println("The session is now closed");
>                    logger.info("Mina client session is getting closed");
>                }
>            });
>
> ---------------------------------------Mina Server Code snippet ---------------------------------------------------------
>        acceptor = new NioSocketAcceptor();
>
>        acceptor.getFilterChain().addLast( "logger",
>                                           new LoggingFilter() );
>        acceptor.getFilterChain().addLast( "codec",
>                                           new ProtocolCodecFilter( new ObjectSerializationCodecFactory() ) );
>
>        acceptor.setHandler( handler );
>        acceptor.getSessionConfig().setReadBufferSize( 2048 );
>        acceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE,
>                                                 3 );
>
>        acceptor.bind( new InetSocketAddress( "127.0.0.1", port ) );

Re: changes from Mina 2.0.0-M3 to 2.0.0-M6 to 2.0.0-RC1

Posted by Ashish <pa...@gmail.com>.
The best way would be to take Thread dumps and see what's going on inside.
Using a logging filter could tell you a little more when things have
been processed...

thanks
ashish

On Tue, Apr 20, 2010 at 9:53 PM, Vijay K Pandey <VP...@mdes.ms.gov> wrote:
> Hi,
>
> I have an application which has a very simple scenario of sending Java POJO(serializable) objects from Mina client to server and client waits for the response.
>
> It was all working very fine with mina-core-2.0.0-M3.jar but looks like something has changed in  mina-core-2.0.0-M6.jar and mina-core-2.0.0-RC1.jar where on several messages mina server receives the message from client ( both process running on same machine) after a delay of 5 seconds. I can see that on client side LoggingFilter has written the message but then there is a delay on server side when it is received.
>
> I ran  the test on the same "dataset" for the above 3 versions of MINA and - M3 runs fine without any issue and there is no delay. I am testing this in a controlled environment where at any given point of time only 1 message is sent. Only after the response is received, does the second message is sent out.
>
> Message is basically  - an array List - have 3 members where2 members are of string type and  1 member is HashMap of around 12 objects(11 are simple primitive wrappers and 1 POJO - having 6 primitives wrappers)
>
> Can someone point me to the right direction?
>
> Thanks
> Vijay
>
> -----------------Mina client code snippet ------------
>            connector.getFilterChain().addLast("codec",new ProtocolCodecFilter(new ObjectSerializationCodecFactory()));
>            connector.getFilterChain().addLast( "logger",new LoggingFilter() );
>            connector.setConnectTimeoutMillis(30 * 1000);
>
>            ConnectFuture future1 = connector.connect( address );
>            future1.awaitUninterruptibly(15, TimeUnit.SECONDS);
>            if (!future1.isConnected()) {
>                  return false;
>            }
>            session = future1.getSession();
>
>            CloseFuture closeFuture = session.getCloseFuture();
>            closeFuture.addListener((IoFutureListener<?>) new IoFutureListener<IoFuture>() {
>                public void operationComplete(IoFuture future) {
>                    System.out.println("The session is now closed");
>                    logger.info("Mina client session is getting closed");
>                }
>            });
>
> ---------------------------------------Mina Server Code snippet ---------------------------------------------------------
>        acceptor = new NioSocketAcceptor();
>
>        acceptor.getFilterChain().addLast( "logger",
>                                           new LoggingFilter() );
>        acceptor.getFilterChain().addLast( "codec",
>                                           new ProtocolCodecFilter( new ObjectSerializationCodecFactory() ) );
>
>        acceptor.setHandler( handler );
>        acceptor.getSessionConfig().setReadBufferSize( 2048 );
>        acceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE,
>                                                 3 );
>
>        acceptor.bind( new InetSocketAddress( "127.0.0.1", port ) );