You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ron Cecchini <ro...@comcast.net> on 2018/08/20 19:30:49 UTC
How to disable a servlet?
Hi there.
I am trying to run 2 Spring Boot / Camel applications at the same time, and the 2nd app complains about port 8080 already being in use.
However, the 2nd app doesn't even need to expose any endpoints; it's just reading messages off a RabbitMQ bus that the first app is producing. So I tried getting the 2nd app to *not* start up a 'servlet' -- and that's where I've run into trouble. I'm not explicitly doing anything with endpoints in this 2nd app or configuring a servlet. It just has one simple route to read from a bus and transform the message.
I tried getting rid of the servlet dependency in the POM (it was copy and pasted there), thinking that maybe the servlet is auto-started if the dependency is there -- but that didn't do it.
After much digging, I eventually discovered that I can set 'server.port' to something other than 8080 -- and that worked, in the sense that I can now start up the 2 apps and write/read to/from the bus.
But for my own education, I would *still * like to know how I can disable that 2nd servlet, esp. since it's not needed.
Thank you very much.
Ron
Re: How to disable a servlet?
Posted by Ron Cecchini <ro...@comcast.net>.
Thanks, Claus. Worked perfectly.
(sent off list because I didn't want to add more noise to the list.)
> On August 20, 2018 at 4:54 PM Claus Ibsen <cl...@gmail.com> wrote:
>
>
> Hi
>
> If its a spring boot application then you can remove the -web-starter
> dependency if you dont need servlet/http.
>
> Then you need to set Camel's main controller to true in the
> application.properties to keep the app/JVM running.
> camel.springboot.main-run-controller = true
>
> Otherwise if you must have SB -web-starter then you can do as you
> found out, reconfigure it to use a different port number than 8080.
>
>
> On Mon, Aug 20, 2018 at 9:30 PM, Ron Cecchini <ro...@comcast.net> wrote:
> > Hi there.
> >
> >
> > I am trying to run 2 Spring Boot / Camel applications at the same time, and the 2nd app complains about port 8080 already being in use.
> >
> >
> > However, the 2nd app doesn't even need to expose any endpoints; it's just reading messages off a RabbitMQ bus that the first app is producing. So I tried getting the 2nd app to *not* start up a 'servlet' -- and that's where I've run into trouble. I'm not explicitly doing anything with endpoints in this 2nd app or configuring a servlet. It just has one simple route to read from a bus and transform the message.
> >
> >
> > I tried getting rid of the servlet dependency in the POM (it was copy and pasted there), thinking that maybe the servlet is auto-started if the dependency is there -- but that didn't do it.
> >
> >
> > After much digging, I eventually discovered that I can set 'server.port' to something other than 8080 -- and that worked, in the sense that I can now start up the 2 apps and write/read to/from the bus.
> >
> >
> > But for my own education, I would *still * like to know how I can disable that 2nd servlet, esp. since it's not needed.
> >
> >
> > Thank you very much.
> >
> >
> > Ron
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
Re: How to disable a servlet?
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
If its a spring boot application then you can remove the -web-starter
dependency if you dont need servlet/http.
Then you need to set Camel's main controller to true in the
application.properties to keep the app/JVM running.
camel.springboot.main-run-controller = true
Otherwise if you must have SB -web-starter then you can do as you
found out, reconfigure it to use a different port number than 8080.
On Mon, Aug 20, 2018 at 9:30 PM, Ron Cecchini <ro...@comcast.net> wrote:
> Hi there.
>
>
> I am trying to run 2 Spring Boot / Camel applications at the same time, and the 2nd app complains about port 8080 already being in use.
>
>
> However, the 2nd app doesn't even need to expose any endpoints; it's just reading messages off a RabbitMQ bus that the first app is producing. So I tried getting the 2nd app to *not* start up a 'servlet' -- and that's where I've run into trouble. I'm not explicitly doing anything with endpoints in this 2nd app or configuring a servlet. It just has one simple route to read from a bus and transform the message.
>
>
> I tried getting rid of the servlet dependency in the POM (it was copy and pasted there), thinking that maybe the servlet is auto-started if the dependency is there -- but that didn't do it.
>
>
> After much digging, I eventually discovered that I can set 'server.port' to something other than 8080 -- and that worked, in the sense that I can now start up the 2 apps and write/read to/from the bus.
>
>
> But for my own education, I would *still * like to know how I can disable that 2nd servlet, esp. since it's not needed.
>
>
> Thank you very much.
>
>
> Ron
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2