You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Song Thuy Nguyen <pr...@biaqua.de> on 2010/03/23 22:51:18 UTC

Separate port for each deployed Web Service or WAR file?

Hello,

I would like to configure the listen/connection port for each Web Service or each WAR file I deploy. Is this possible with Tomcat?

For example:

 in a development  environment, I have a simple web service called "MultiplicationService". If I deploy it on Tomcat in a WAR file this web service would get this URL:

http://localhost:8080/Functions/ExponentiationService

Now I would like to change the port number on which this service is listening, like:

http://localhost:1234/Functions/ExponentiationService

but this configuration should not be global, Tomcat and other web services should still reachable at the standard 8080 port of Tomcat.

Thanks in advance for your help!

 

Song Thuy Nguyen


RE: Separate port for each deployed Web Service or WAR file?

Posted by Song Thuy Nguyen <pr...@biaqua.de>.
Hi Mark,
I'm looking for a workaround to a problem: I'm using the failover feature of Apache Synapse (there will be several backup/alternate web service with the same interface to a primary  web service, if the primiary service fails one of the replacements will be called without the notice of the caller (service consumer)). But there is a catch: in the recent version of Synapse one endpoint to a web service will only be seen as failed if the connection to this port will be refused (mostly due to a transport error). But if I deploy the web service on Tomcat every web services will listen to the one standard port. Any incoming request to the standard port of Tomcat calling a service that is inactive will be accepted and then answer with a http 404 error (like service not found or something). For synapse this is a conform answer and it will forward it to the caller. But this is not really what a failover should do. For now the failover only works if the whole application server (Tomcat) is offline/down and any call to the port is beeing rejected.
If you still have doubts about the sense of this scenario, rest assured, there are several other users requesting Synapse failover to treat a http-404 error as a reason to call the secondary services. This feature will probably be implemented in a future version of Synapse. Until then, I want to try a workaround to evaluate such a system.
Is there anyway you could help me?

Song Thuy Nguyen

> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Tuesday, March 23, 2010 11:00 PM
> To: Tomcat Users List
> Subject: Re: Separate port for each deployed Web Service or WAR file?
> 
> On 23/03/2010 21:51, Song Thuy Nguyen wrote:
> > Hello,
> >
> > I would like to configure the listen/connection port for each Web
> Service or each WAR file I deploy.
> 
> Why? What are you trying to achieve?
> 
> Mark
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Separate port for each deployed Web Service or WAR file?

Posted by Mark Thomas <ma...@apache.org>.
On 23/03/2010 21:51, Song Thuy Nguyen wrote:
> Hello,
> 
> I would like to configure the listen/connection port for each Web Service or each WAR file I deploy.

Why? What are you trying to achieve?

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org