Use another Object type with TextLineEncoder
Hi, I have a Client that use a TextLineCodecFactory to send Message. So I think normally I must sometimes like that when I want to send a Message: ioSession.write(message); // where message is from type String Now, can I do something like that inside ? ioSession.write(request) // where request is an Object of a class "JSONRPCRequest" I asked because, I'm trying to send some big message: log.debug(req); //output: {"method":"SetBandingProfile","id":322,"Client_ID":"LVIS","params":{"ColPack":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"Package":33},"jsonrpc":"2.0","Protocol":"2H"} ioSession.write(req); Now the Encoder (TextLineEncoder) received the message and I also made an output : //output {"method":"SetBandingProfile","id":322,"Client_ID":"LVIS","params":{"ColPack":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}],"Package":{}},"jsonrpc":"2.0","Protocol":"2H"} My message become unaivalable. When use TextLineCodecFactory, it's recommend to send only String? Best Regards Boris Confidentiality note: The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.
RE: Ensure sequential execution
Thanks, this answer my question! -Original Message- From: Emmanuel Lécharny [mailto:elecha...@gmail.com] Sent: Tuesday, August 16, 2016 11:20 AM To: users@mina.apache.org Subject: Re: Ensure sequential execution Le 16/08/16 à 11:15, Simo Chiegang, Boris Arthur a écrit : > I guys, I have the following Problem: > > > - I defined a Server to handle some Json Strings. > > Acceptor a = new NioSocketAcceptor(); > > > > - I had some filters so: > > a.getFilterChain().clear(); // I removed all filters > > a.getFilterChain().addLast("jsonString", new > ProtocolCodecFilter(...)); > > a.setHandler(myHandler); > > I want to know, if in my case the newer event is not processed if the event > handler method for the older event for the same session hasn't returned yet? Not sure I understand... Let me try to give an answer that might fit your question : as soon as one session is created, and as soon as you don't have an executor in the chian, then any message send by the client will be processed in the exact order it has been sent. Ie, if a client sends 2 messages A and B, they will be preocessed in teh same order, A then B. > Or I always need an Executor Filter? No, you rarely need an executor filter. > > In my requirement, I don't need parallel processing. I must wait that the > event handler complete executes before start to handle the new event. That is what will happen, always. Confidentiality note: The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.
Re: Ensure sequential execution
Le 16/08/16 à 11:15, Simo Chiegang, Boris Arthur a écrit : > I guys, I have the following Problem: > > > - I defined a Server to handle some Json Strings. > > Acceptor a = new NioSocketAcceptor(); > > > > - I had some filters so: > > a.getFilterChain().clear(); // I removed all filters > > a.getFilterChain().addLast("jsonString", new ProtocolCodecFilter(...)); > > a.setHandler(myHandler); > > I want to know, if in my case the newer event is not processed if the event > handler method for the older event for the same session hasn't returned yet? Not sure I understand... Let me try to give an answer that might fit your question : as soon as one session is created, and as soon as you don't have an executor in the chian, then any message send by the client will be processed in the exact order it has been sent. Ie, if a client sends 2 messages A and B, they will be preocessed in teh same order, A then B. > Or I always need an Executor Filter? No, you rarely need an executor filter. > > In my requirement, I don't need parallel processing. I must wait that the > event handler complete executes before start to handle the new event. That is what will happen, always.
Ensure sequential execution
I guys, I have the following Problem: - I defined a Server to handle some Json Strings. Acceptor a = new NioSocketAcceptor(); - I had some filters so: a.getFilterChain().clear(); // I removed all filters a.getFilterChain().addLast("jsonString", new ProtocolCodecFilter(...)); a.setHandler(myHandler); I want to know, if in my case the newer event is not processed if the event handler method for the older event for the same session hasn't returned yet? Or I always need an Executor Filter? In my requirement, I don't need parallel processing. I must wait that the event handler complete executes before start to handle the new event. Thanks Confidentiality note: The information in this email and any attachment may contain confidential and proprietary information of Heidelberger Druckmaschinen AG and/or its affiliates and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, you are hereby notified that any review, reliance or distribution by others or forwarding without express permission is strictly prohibited and may cause liability. In case you have received this message due to an error in transmission, we kindly ask you to notify the sender immediately and to delete this email and any attachment from your system.
Apache SSHD client performance
I have an application using apache SSHD to send files via sftp (with the SftpClient class). I have noticed that the performance was very poor and I made a simple test comparing apache SSHD with Jsch, which gives much better results (seven times faster!) comparable with the openssh implementation. Even though the performance can be partly improved (~30%) by changing the buffer size, for example, I haven't been able to match Jsch's performance by a long shot. Has anybody noticed similar performance issues using apache SSHD as a client? Do you have any suggestions to tune the performance, besides the buffer size? Nicola