2

Issue:

  • I would need to change the basic /camel url which camel uses by default, but when i try to change it in application.yml nothing happens to it.
  • Would like to keep other systems intact without changing their urls, from what they already have (would require quiet a bit of work in back-end systems)

Current URL: http://localhost:8080/camel/hello

Desired URL: http://localhost:8080/service/hello

Checked links which are NOT working for me:

Link1

Link2

Link3

EG: application.yml

 camel:
  springboot:
    name: CamelRestContext
  component:
    servlet:
      mapping:
        enabled: true
        context-path: /service

1 Answers1

2

So apparently this way works:

camel:
  springboot:
    name: RestDSLContext
  servlet:
    mapping:
      context-path: /service/*
  rest:
    context-path: /service
  • In most of the other posts `camel.component.servlet.mapping.context-path` is the answer, which does not work. For me, i just needed the `camel.servlet.mapping.context-path` setting, the `rest` and `springboot` part was not necessary. Thank you very much for that hint! Still strange is, that after starting the app, the context-path is still empty while logging: `CamelHttpTransportServlet[name=CamelServlet, contextPath=]` – Zeussi Feb 01 '22 at 14:02
  • Yes for whatever reason when using `yaml` u need to define the `URL/ component`. As for the `contextPath` being empty, that can be changed also, but then that `contextPath` will be added also to the `URL`, so i found it easier to leave it empty. – Szilágyi István Feb 03 '22 at 07:31