You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Samuel Doyle <sd...@yahoo.com> on 2006/03/03 23:32:50 UTC

Another question on using mina as a proxy server.

Hi, I'm basically attempting to use mina to act as a
proxy server something like discussed in the previous
example:
http://www.nabble.com/-MINA-Using-MINA-to-write-a-proxy-server-like-application-t656623.html
However, the case I have is not 1:1 on the client and
server session basis.

The situation I have involves a client which spawns
multiple processes, each opening its own connection to
my proposed mina server. The mina server itself has a
persistent fixed amount of connections to the actual
server to distribute the client requests with. The
client connections are short lived are only open to
process a single request while the mina->server should
always be open.

Client 1<---------|
                  |          Persistent Conn 1
Client 2<--------||     |-------------->
                Mina Server            Actual Server
Client 3<--------||     |-------------->
                  |          Persistent Conn 2
Client 4<---------|

The amount of client connections is variable but the
connections from mina to the actual server is always
fixed. My question is, what is the best way to demux
the responses from the actual server to the
appropriate client? One of the fixed mina->server
sessions may have several client->mina sessions
attached to it at one time. Is there something Mina
provides to do this or do I need to come up with some
home grown based version?

Thanks, S.D.

Re: Another question on using mina as a proxy server.

Posted by Vinod Panicker <vi...@gmail.com>.
Hi Samuel,

On 3/4/06, Samuel Doyle <sd...@yahoo.com> wrote:
> Hi, I'm basically attempting to use mina to act as a
> proxy server something like discussed in the previous
> example:
> http://www.nabble.com/-MINA-Using-MINA-to-write-a-proxy-server-like-application-t656623.html
> However, the case I have is not 1:1 on the client and
> server session basis.

<snip/>

> The amount of client connections is variable but the
> connections from mina to the actual server is always
> fixed. My question is, what is the best way to demux
> the responses from the actual server to the
> appropriate client? One of the fixed mina->server
> sessions may have several client->mina sessions
> attached to it at one time. Is there something Mina
> provides to do this or do I need to come up with some
> home grown based version?

Even I need something like this.  If you dont mind, do keep us posted
about the approach you plan to take.  The challenge is to keep the
mina proxy agnostic of the application protocol.  Trustin, remember I
was talking about this same thing a few days ago?  This would be
really cool for HA server apps.

Regards,
Vinod.

Re: Another question on using mina as a proxy server.

Posted by Samuel Doyle <sd...@yahoo.com>.
Your response is what I was sort of expecting but
wasn't sure if there might've been something behind
the scenes mina provided that I could use.

Thanks though for the quick response.

S.D.

--- Trustin Lee <tr...@gmail.com> wrote:

> On 3/4/06, Samuel Doyle <sd...@yahoo.com> wrote:
> >
> > Nobody has any suggestions on using some form of
> mina
> > provided approach for this?
> 
> 
> It takes some time for you to get a response;
> because it's an open source
> software. It can even take a week. :)
> 
> > Hi, I'm basically attempting to use mina to act as
> a
> > > proxy server something like discussed in the
> > > previous
> > > example:
> > >
> >
> >
>
http://www.nabble.com/-MINA-Using-MINA-to-write-a-proxy-server-like-application-t656623.html
> > > However, the case I have is not 1:1 on the
> client
> > > and
> > > server session basis.
> > >
> > > The situation I have involves a client which
> spawns
> > > multiple processes, each opening its own
> connection
> > > to
> > > my proposed mina server. The mina server itself
> has
> > > a
> > > persistent fixed amount of connections to the
> actual
> > > server to distribute the client requests with.
> The
> > > client connections are short lived are only open
> to
> > > process a single request while the mina->server
> > > should
> > > always be open.
> > >
> > > Client 1<---------|
> > >                   |          Persistent Conn 1
> > > Client 2<--------||     |-------------->
> > >                 Mina Server            Actual
> Server
> > > Client 3<--------||     |-------------->
> > >                   |          Persistent Conn 2
> > > Client 4<---------|
> > >
> > > The amount of client connections is variable but
> the
> > > connections from mina to the actual server is
> always
> > > fixed. My question is, what is the best way to
> demux
> > > the responses from the actual server to the
> > > appropriate client? One of the fixed
> mina->server
> > > sessions may have several client->mina sessions
> > > attached to it at one time. Is there something
> Mina
> > > provides to do this or do I need to come up with
> > > some
> > > home grown based version?
> 
> 
> There's no special way to implement it.  To do so,
> there has to be an
> identifier for each message so you can determins
> which message belongs to
> which client.  Plus, the proxy should be able to
> interpret the message so it
> can extract the ID field.  That's all.
> 
> HTH,
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP key fingerprints:
> * E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
> * B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6
> 


Re: Another question on using mina as a proxy server.

Posted by Trustin Lee <tr...@gmail.com>.
On 3/4/06, Samuel Doyle <sd...@yahoo.com> wrote:
>
> Nobody has any suggestions on using some form of mina
> provided approach for this?


It takes some time for you to get a response; because it's an open source
software. It can even take a week. :)

> Hi, I'm basically attempting to use mina to act as a
> > proxy server something like discussed in the
> > previous
> > example:
> >
>
> http://www.nabble.com/-MINA-Using-MINA-to-write-a-proxy-server-like-application-t656623.html
> > However, the case I have is not 1:1 on the client
> > and
> > server session basis.
> >
> > The situation I have involves a client which spawns
> > multiple processes, each opening its own connection
> > to
> > my proposed mina server. The mina server itself has
> > a
> > persistent fixed amount of connections to the actual
> > server to distribute the client requests with. The
> > client connections are short lived are only open to
> > process a single request while the mina->server
> > should
> > always be open.
> >
> > Client 1<---------|
> >                   |          Persistent Conn 1
> > Client 2<--------||     |-------------->
> >                 Mina Server            Actual Server
> > Client 3<--------||     |-------------->
> >                   |          Persistent Conn 2
> > Client 4<---------|
> >
> > The amount of client connections is variable but the
> > connections from mina to the actual server is always
> > fixed. My question is, what is the best way to demux
> > the responses from the actual server to the
> > appropriate client? One of the fixed mina->server
> > sessions may have several client->mina sessions
> > attached to it at one time. Is there something Mina
> > provides to do this or do I need to come up with
> > some
> > home grown based version?


There's no special way to implement it.  To do so, there has to be an
identifier for each message so you can determins which message belongs to
which client.  Plus, the proxy should be able to interpret the message so it
can extract the ID field.  That's all.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Re: Another question on using mina as a proxy server.

Posted by Samuel Doyle <sd...@yahoo.com>.
Nobody has any suggestions on using some form of mina
provided approach for this?

Thanks, S.D.

--- Samuel Doyle <sd...@yahoo.com> wrote:

> Hi, I'm basically attempting to use mina to act as a
> proxy server something like discussed in the
> previous
> example:
>
http://www.nabble.com/-MINA-Using-MINA-to-write-a-proxy-server-like-application-t656623.html
> However, the case I have is not 1:1 on the client
> and
> server session basis.
> 
> The situation I have involves a client which spawns
> multiple processes, each opening its own connection
> to
> my proposed mina server. The mina server itself has
> a
> persistent fixed amount of connections to the actual
> server to distribute the client requests with. The
> client connections are short lived are only open to
> process a single request while the mina->server
> should
> always be open.
> 
> Client 1<---------|
>                   |          Persistent Conn 1
> Client 2<--------||     |-------------->
>                 Mina Server            Actual Server
> Client 3<--------||     |-------------->
>                   |          Persistent Conn 2
> Client 4<---------|
> 
> The amount of client connections is variable but the
> connections from mina to the actual server is always
> fixed. My question is, what is the best way to demux
> the responses from the actual server to the
> appropriate client? One of the fixed mina->server
> sessions may have several client->mina sessions
> attached to it at one time. Is there something Mina
> provides to do this or do I need to come up with
> some
> home grown based version?
> 
> Thanks, S.D.
>