You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Lohith Kumar Reddy G <Lo...@infosys.com> on 2010/11/23 10:27:47 UTC

Building Proxy server Usinf mina to change Response

Hi All,
           We want to build a proxy server for some standard servers(e.g tomcat)using Mina API.

Main functionalities of proxy server will be
1.Chanding request parameters
2.Changing the response.
3.Deleting the response
..


Above things will be done depending on some rules.

Can I use  mina in order to build such proxy server.

How scalable will the server be if we use .

If such a code exists ,can I know the url to access that.

Please share some materials  which can help me in process of  building  the server.

Regards
Lohith




**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Re: Building Proxy server Usinf mina to change Response

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/23/10 10:27 AM, Lohith Kumar Reddy G wrote:
> Hi All,
>             We want to build a proxy server for some standard servers(e.g tomcat)using Mina API.
>
> Main functionalities of proxy server will be
> 1.Chanding request parameters
> 2.Changing the response.
> 3.Deleting the response
> ..
>
>
> Above things will be done depending on some rules.
>
> Can I use  mina in order to build such proxy server.
Why not ?
> How scalable will the server be if we use .
How possibly can we answer this kind of question ? It has nothing to do 
with MINA? all to do with your ability on definig a good architecture 
and writing good code ...
> If such a code exists ,can I know the url to access that.
Google.com
> Please share some materials  which can help me in process of  building  the server.
Everything is available on Internet. Just do your homework.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Building Proxy server Usinf mina to change Response

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 11/23/10 6:37 PM, John Plocher wrote:
> Newbie question:  What's the difference/relationship between netty and
> mina?  They share many similarities, but mina seems stuck trying to get its
> docs and examples updated from 1.0 to 2.0, while netty comes across as more
> active and up to date.   I'm new to both, and having a blast with mina, but
> I'm wondering where the community energy is focused...
MINA was started by Trustin when ApacheDS needed an NIO framework back 7 
years ago. When MINA 2.0 was almost done, he quit the project and 
started NETTY at Jboss. The doco was left in the state he left it, and 
we are focusing on the code.

Being a JBoss employee, working on Netty, it's pretty normal that there 
is more activity around it.

Now, it's all about the community and the governance. You may like 
better one or the other project, it's not a big deal. And you may also 
prefer an open community that will survive if the company paying the 
bill stops doing so...

Volunteers are always welcome !

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Building Proxy server Usinf mina to change Response

Posted by John Plocher <jo...@gmail.com>.
It sounds like my next task is to take the server I wrote using Mina and
"port" it to Netty to see what the real differences are. I'll post a
followup here in a few days after I get a blog up with the source code for
my NBD-on-Mina prototype.  My eventual goal is to have a production capable
server using NIO and zero-copy, though at the moment I'm still experimenting
with different frameworks...

Thanks all for your responses.

    -John

On Tue, Nov 23, 2010 at 10:41 PM, Christian Migowski
<ch...@gmail.com>wrote:
>
>
> Here is my (I am a former Mina user and now Netty user) perception:
>
>

Re: Building Proxy server Usinf mina to change Response

Posted by Christian Migowski <ch...@gmail.com>.
Hi,

On Tue, Nov 23, 2010 at 6:37 PM, John Plocher <jo...@gmail.com> wrote:
> Newbie question:  What's the difference/relationship between netty and
> mina?  They share many similarities, but mina seems stuck trying to get its
> docs and examples updated from 1.0 to 2.0, while netty comes across as more
> active and up to date.   I'm new to both, and having a blast with mina, but
> I'm wondering where the community energy is focused...

Here is my (I am a former Mina user and now Netty user) perception:
Trustin Lee, who was the main driving force behind Mina, left the
project some years ago because of attitude issues with some other
members of the project (in a community, things like this happen) and
started Netty to further push his ideas of a good java network
library. Since then, because I was using the "Mina core" (for writing
my own codecs) and not its subprojects like ftpd, sshd and so on, Mina
was pretty much dead to me, IMO most of the visible real development
(new features, API improvements) took place in the subprojects which
doesn't matter to me.

Netty, on the other hand, started with an amazing pace and is still
delivering new releases with new features every few months. As far as
I know, Netty is not a Jboss paid project, Trustin claims to take care
of it in its spare time, also there are some other people working from
time to time on it, so what Emmanuel said is supposedly not true. From
my users perspective, Netty is clearly the better choice because it
has a cleaner API and is much more documented. (btw. I am not paid to
write this ;) I just think Netty is really useful)


hth,
christian

>   -John
>
>
> On Tue, Nov 23, 2010 at 5:11 AM, Christian Migowski <ch...@gmail.com>wrote:
>
>> Hi Lohith,
>>
>> you may want to give Netty (http://jboss.org/netty/documentation.html)
>> a try. It has excellent documentation (mostly very convenient in the
>> javadoc) and also ships with easy-to-understand examples for Proxy
>> servers and http codecs (which are also included).
>>
>>
>

Re: Building Proxy server Usinf mina to change Response

Posted by Emmanuel Lecharny <el...@gmail.com>.
I would also add that MINA has its own life now. Many subprojects are 
using it :
- Vysper, an XMPP implementation
- FtpServer
- SSHd
- AsyncWeb (right now, a bit dormant)

Sure, MINA needs a better doco, but it's always the same story : you can 
help :)


On 11/23/10 6:59 PM, Kiran Ayyagari wrote:
> On Tue, Nov 23, 2010 at 7:37 PM, John Plocher<jo...@gmail.com>  wrote:
>> Newbie question:  What's the difference/relationship between netty and
>> mina?  They share many similarities, but mina seems stuck trying to get its
>> docs and examples updated from 1.0 to 2.0, while netty comes across as more
>> active and up to date.   I'm new to both, and having a blast with mina, but
>> I'm wondering where the community energy is focused...
>>
> We at Apache Directory Server use MINA in our network layer and the
> core developers of MINA
> are also part of Directory project so they will make sure that MINA
> works and is correctly maintained.
> Oh yeah, did I tell you that MINA was a brain child of Directory team
> and has become a separate project on its own :)
>
>>    -John
>>
>>
>> On Tue, Nov 23, 2010 at 5:11 AM, Christian Migowski<ch...@gmail.com>wrote:
>>
>>> Hi Lohith,
>>>
>>> you may want to give Netty (http://jboss.org/netty/documentation.html)
>>> a try. It has excellent documentation (mostly very convenient in the
>>> javadoc) and also ships with easy-to-understand examples for Proxy
>>> servers and http codecs (which are also included).
>>>
>>>
>
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Re: Building Proxy server Usinf mina to change Response

Posted by Kiran Ayyagari <ka...@apache.org>.
On Tue, Nov 23, 2010 at 7:37 PM, John Plocher <jo...@gmail.com> wrote:
> Newbie question:  What's the difference/relationship between netty and
> mina?  They share many similarities, but mina seems stuck trying to get its
> docs and examples updated from 1.0 to 2.0, while netty comes across as more
> active and up to date.   I'm new to both, and having a blast with mina, but
> I'm wondering where the community energy is focused...
>
We at Apache Directory Server use MINA in our network layer and the
core developers of MINA
are also part of Directory project so they will make sure that MINA
works and is correctly maintained.
Oh yeah, did I tell you that MINA was a brain child of Directory team
and has become a separate project on its own :)

>   -John
>
>
> On Tue, Nov 23, 2010 at 5:11 AM, Christian Migowski <ch...@gmail.com>wrote:
>
>> Hi Lohith,
>>
>> you may want to give Netty (http://jboss.org/netty/documentation.html)
>> a try. It has excellent documentation (mostly very convenient in the
>> javadoc) and also ships with easy-to-understand examples for Proxy
>> servers and http codecs (which are also included).
>>
>>
>



-- 
Kiran Ayyagari

Re: Building Proxy server Usinf mina to change Response

Posted by John Plocher <jo...@gmail.com>.
Newbie question:  What's the difference/relationship between netty and
mina?  They share many similarities, but mina seems stuck trying to get its
docs and examples updated from 1.0 to 2.0, while netty comes across as more
active and up to date.   I'm new to both, and having a blast with mina, but
I'm wondering where the community energy is focused...

   -John


On Tue, Nov 23, 2010 at 5:11 AM, Christian Migowski <ch...@gmail.com>wrote:

> Hi Lohith,
>
> you may want to give Netty (http://jboss.org/netty/documentation.html)
> a try. It has excellent documentation (mostly very convenient in the
> javadoc) and also ships with easy-to-understand examples for Proxy
> servers and http codecs (which are also included).
>
>

Re: Regarding DIRMINA-912

Posted by Mike McKnight <mi...@mcknight4.com>.
It is all working fine...I just followed the workaround suggestion in 
the min bug I referenced.  My only point was that I believe this is a 
bug in the MINA framework that should be fixed and could be addressed 
rather simply.

On 08/25/2013 10:36 AM, Jon V. wrote:
> Sounds like you need a task queue and a single dispatcher thread. Write the
> metered messages to the task queue and let it do the temporal management.
> This can all be done with one thread.
> On Aug 25, 2013 11:57 AM, "Mike McKnight" <mi...@mcknight4.com> wrote:
>
>> In my case I have units on the ground that need to have messages throttled
>> when being sent to the units. In other words all of the queued write events
>> going to each unit need to be metered out in an temporal fashion.  I have a
>> separate thread pool available that can expand to the number of units on
>> the ground, which is max around 50, and handles this metering process.
>>   Message processing for all but WRITE events needs to be unfettered in any
>> way and can not be held up for writes being throttled.  So for sure I need
>> another executor filter that handles all but WRITE events.
>>
>> I don't see how I can do this with a single executor filter. As events are
>> processed in order in a queue and if I am waiting on a write then
>> MESSAGE_RECEIVED events are not going to get processed. There are no
>> separate SessionTasksQueue for the OrderedThreadPoolExecutor, just the one
>> for all events waiting to be processed.
>>
>> Filter chain looks like this:
>>   * codec
>>   * inbound-filter (executor filter for all but WRITE events)
>>   * write-throttle-filter (overrides filterWrite)
>>   * outbound-filter (executor filter for WRITE events only)
>> On 08/23/2013 12:32 PM, Jon V. wrote:
>>
>>> What is the use case for having different thread pools for read and write
>>> events?
>>>
>>> Writes are already scheduled one they hit the worker. Not like your write
>>> process is going to slow down an already threaded read request.
>>> On Aug 22, 2013 5:52 PM, "Mike McKnight"<mi...@mcknight4.com>  wrote:
>>>
>>>   I am just curious if there is a downside to this issue that I am not
>>>> seeing.  I have seen this in my MINA application; I have inbound/outbound
>>>> executor filters as described in the issue and have seen where my inbound
>>>> threads are *sometimes* processing IoEventType.WRITE events.  I don't see
>>>> any adverse effects of this, my messages are being put on the wire, but
>>>> am
>>>> checking in with the list to be sure.
>>>>
>>>> I am running mina-2.0.7.
>>>>
>>>> https://issues.apache.org/****jira/browse/DIRMINA-912<https://issues.apache.org/**jira/browse/DIRMINA-912>
>>>> <https:**//issues.apache.org/jira/**browse/DIRMINA-912<https://issues.apache.org/jira/browse/DIRMINA-912>
>>>> Thanks!
>>>>
>>>> Mike
>>>>
>>>>


Re: Regarding DIRMINA-912

Posted by "Jon V." <sy...@gmail.com>.
Sounds like you need a task queue and a single dispatcher thread. Write the
metered messages to the task queue and let it do the temporal management.
This can all be done with one thread.
On Aug 25, 2013 11:57 AM, "Mike McKnight" <mi...@mcknight4.com> wrote:

> In my case I have units on the ground that need to have messages throttled
> when being sent to the units. In other words all of the queued write events
> going to each unit need to be metered out in an temporal fashion.  I have a
> separate thread pool available that can expand to the number of units on
> the ground, which is max around 50, and handles this metering process.
>  Message processing for all but WRITE events needs to be unfettered in any
> way and can not be held up for writes being throttled.  So for sure I need
> another executor filter that handles all but WRITE events.
>
> I don't see how I can do this with a single executor filter. As events are
> processed in order in a queue and if I am waiting on a write then
> MESSAGE_RECEIVED events are not going to get processed. There are no
> separate SessionTasksQueue for the OrderedThreadPoolExecutor, just the one
> for all events waiting to be processed.
>
> Filter chain looks like this:
>  * codec
>  * inbound-filter (executor filter for all but WRITE events)
>  * write-throttle-filter (overrides filterWrite)
>  * outbound-filter (executor filter for WRITE events only)
> On 08/23/2013 12:32 PM, Jon V. wrote:
>
>> What is the use case for having different thread pools for read and write
>> events?
>>
>> Writes are already scheduled one they hit the worker. Not like your write
>> process is going to slow down an already threaded read request.
>> On Aug 22, 2013 5:52 PM, "Mike McKnight"<mi...@mcknight4.com>  wrote:
>>
>>  I am just curious if there is a downside to this issue that I am not
>>> seeing.  I have seen this in my MINA application; I have inbound/outbound
>>> executor filters as described in the issue and have seen where my inbound
>>> threads are *sometimes* processing IoEventType.WRITE events.  I don't see
>>> any adverse effects of this, my messages are being put on the wire, but
>>> am
>>> checking in with the list to be sure.
>>>
>>> I am running mina-2.0.7.
>>>
>>> https://issues.apache.org/****jira/browse/DIRMINA-912<https://issues.apache.org/**jira/browse/DIRMINA-912>
>>> <https:**//issues.apache.org/jira/**browse/DIRMINA-912<https://issues.apache.org/jira/browse/DIRMINA-912>
>>> >
>>>
>>> Thanks!
>>>
>>> Mike
>>>
>>>
>

Re: Regarding DIRMINA-912

Posted by Mike McKnight <mi...@mcknight4.com>.
In my case I have units on the ground that need to have messages 
throttled when being sent to the units. In other words all of the queued 
write events going to each unit need to be metered out in an temporal 
fashion.  I have a separate thread pool available that can expand to the 
number of units on the ground, which is max around 50, and handles this 
metering process.  Message processing for all but WRITE events needs to 
be unfettered in any way and can not be held up for writes being 
throttled.  So for sure I need another executor filter that handles all 
but WRITE events.

I don't see how I can do this with a single executor filter. As events 
are processed in order in a queue and if I am waiting on a write then 
MESSAGE_RECEIVED events are not going to get processed. There are no 
separate SessionTasksQueue for the OrderedThreadPoolExecutor, just the 
one for all events waiting to be processed.

Filter chain looks like this:
  * codec
  * inbound-filter (executor filter for all but WRITE events)
  * write-throttle-filter (overrides filterWrite)
  * outbound-filter (executor filter for WRITE events only)
On 08/23/2013 12:32 PM, Jon V. wrote:
> What is the use case for having different thread pools for read and write
> events?
>
> Writes are already scheduled one they hit the worker. Not like your write
> process is going to slow down an already threaded read request.
> On Aug 22, 2013 5:52 PM, "Mike McKnight"<mi...@mcknight4.com>  wrote:
>
>> I am just curious if there is a downside to this issue that I am not
>> seeing.  I have seen this in my MINA application; I have inbound/outbound
>> executor filters as described in the issue and have seen where my inbound
>> threads are *sometimes* processing IoEventType.WRITE events.  I don't see
>> any adverse effects of this, my messages are being put on the wire, but am
>> checking in with the list to be sure.
>>
>> I am running mina-2.0.7.
>>
>> https://issues.apache.org/**jira/browse/DIRMINA-912<https://issues.apache.org/jira/browse/DIRMINA-912>
>>
>> Thanks!
>>
>> Mike
>>


Re: Regarding DIRMINA-912

Posted by "Jon V." <sy...@gmail.com>.
What is the use case for having different thread pools for read and write
events?

Writes are already scheduled one they hit the worker. Not like your write
process is going to slow down an already threaded read request.
On Aug 22, 2013 5:52 PM, "Mike McKnight" <mi...@mcknight4.com> wrote:

> I am just curious if there is a downside to this issue that I am not
> seeing.  I have seen this in my MINA application; I have inbound/outbound
> executor filters as described in the issue and have seen where my inbound
> threads are *sometimes* processing IoEventType.WRITE events.  I don't see
> any adverse effects of this, my messages are being put on the wire, but am
> checking in with the list to be sure.
>
> I am running mina-2.0.7.
>
> https://issues.apache.org/**jira/browse/DIRMINA-912<https://issues.apache.org/jira/browse/DIRMINA-912>
>
> Thanks!
>
> Mike
>

Re: Regarding DIRMINA-912

Posted by Mike McKnight <mi...@mcknight4.com>.
Agreed...I think I may run into an issue when I am running a 
ThrottlingFilter for IoEventType.WRITE events.  I think that if the 
filter were written such that if the interval between the last message 
sent to an IoSession were not long enough, say 8ms, then the filter 
would need to sleep for some amount of time and if this bug is in play 
then I could envision other events like IoEventType.MESSAGE_RECEIVED not 
getting handled until the thread became available for that IoSession.

Mike

On 08/22/2013 04:51 PM, Emmanuel Lécharny wrote:
> Le 8/22/13 11:51 PM, Mike McKnight a écrit :
>> I am just curious if there is a downside to this issue that I am not
>> seeing.  I have seen this in my MINA application; I have
>> inbound/outbound executor filters as described in the issue and have
>> seen where my inbound threads are *sometimes* processing
>> IoEventType.WRITE events.  I don't see any adverse effects of this, my
>> messages are being put on the wire, but am checking in with the list
>> to be sure.
> If your protocol is stateless, I don't think it's a problem.
>


Re: Regarding DIRMINA-912

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 8/22/13 11:51 PM, Mike McKnight a écrit :
> I am just curious if there is a downside to this issue that I am not
> seeing.  I have seen this in my MINA application; I have
> inbound/outbound executor filters as described in the issue and have
> seen where my inbound threads are *sometimes* processing
> IoEventType.WRITE events.  I don't see any adverse effects of this, my
> messages are being put on the wire, but am checking in with the list
> to be sure.

If your protocol is stateless, I don't think it's a problem.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 


Regarding DIRMINA-912

Posted by Mike McKnight <mi...@mcknight4.com>.
I am just curious if there is a downside to this issue that I am not 
seeing.  I have seen this in my MINA application; I have 
inbound/outbound executor filters as described in the issue and have 
seen where my inbound threads are *sometimes* processing 
IoEventType.WRITE events.  I don't see any adverse effects of this, my 
messages are being put on the wire, but am checking in with the list to 
be sure.

I am running mina-2.0.7.

https://issues.apache.org/jira/browse/DIRMINA-912

Thanks!

Mike

Re: Regarding MINA:DIRMINA-807

Posted by Emmanuel Lecharny <el...@gmail.com>.
Sorry for the delayed answer, was quite busy on another project...

The patch has been applied into trunk, we have a couple of other issues 
to fix before launching a new vote, hopefully this week.

Keep tuned.

On 11/24/10 1:31 AM, Jason Weinstein wrote:
>
> This was the issue which created a DEADLOCK when toString was called.
>
> I believe it was mentioned this was fixed (or going to be fixed in 2.0.2)
>
> If it is already fixed is there a plan for a 2.0.2 release to be 
> available for download??
>
> I am currently using 2.0.1
>
> We would like to upgrade to a released version prior to our release 
> (as well would be good to have some time to test as well)
>
> Can someone update me on general release plan, as well as release for 
> 2.0.2 bug fix(es)
>
> Thanks,
>
> Jason
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com


Regarding MINA:DIRMINA-807

Posted by Jason Weinstein <ja...@oracle.com>.
This was the issue which created a DEADLOCK when toString was called.

I believe it was mentioned this was fixed (or going to be fixed in 2.0.2)

If it is already fixed is there a plan for a 2.0.2 release to be 
available for download??

I am currently using 2.0.1

We would like to upgrade to a released version prior to our release (as 
well would be good to have some time to test as well)

Can someone update me on general release plan, as well as release for 
2.0.2 bug fix(es)

Thanks,

Jason

Re: Building Proxy server Usinf mina to change Response

Posted by Christian Migowski <ch...@gmail.com>.
Hi Lohith,

you may want to give Netty (http://jboss.org/netty/documentation.html)
a try. It has excellent documentation (mostly very convenient in the
javadoc) and also ships with easy-to-understand examples for Proxy
servers and http codecs (which are also included).

hth,
regards,
christian


On Tue, Nov 23, 2010 at 10:27 AM, Lohith Kumar Reddy G
<Lo...@infosys.com> wrote:
> Hi All,
>           We want to build a proxy server for some standard servers(e.g tomcat)using Mina API.
>
> Main functionalities of proxy server will be
> 1.Chanding request parameters
> 2.Changing the response.
> 3.Deleting the response
> ..
>
>
> Above things will be done depending on some rules.
>
> Can I use  mina in order to build such proxy server.
>
> How scalable will the server be if we use .
>
> If such a code exists ,can I know the url to access that.
>
> Please share some materials  which can help me in process of  building  the server.
>
> Regards
> Lohith
>
>
>
>
> **************** CAUTION - Disclaimer *****************
> This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
> for the use of the addressee(s). If you are not the intended recipient, please
> notify the sender by e-mail and delete the original message. Further, you are not
> to copy, disclose, or distribute this e-mail or its contents to any other person and
> any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
> every reasonable precaution to minimize this risk, but is not liable for any damage
> you may sustain as a result of any virus in this e-mail. You should carry out your
> own virus checks before opening the e-mail or attachment. Infosys reserves the
> right to monitor and review the content of all messages sent to or from this e-mail
> address. Messages sent to or from this e-mail address may be stored on the
> Infosys e-mail system.
> ***INFOSYS******** End of Disclaimer ********INFOSYS***
>