Search code examples
javadockeropenshifttika-server

How can i change the context path of tika server?


I want to run the tika server docker image in openshift. This works fine out of the box but as soon as i run other services at the same time i need a context path to determine which service should be addressed in the url.

https://my-openshift-instance.com/my-first-service <- this is a different service working https://my-openshift-instance.com/tika-server <- this is what i need

In Spring Boot applications you just set something like server.servlet.context-path=/my-service-name and it is done. But unfortunately tika server is not based on Spring Boot.

I searched in the official tika-server docs, tika-docker repo as well as the normal tika repo but nowhere was anything documented about context paths.


Solution

  • Until now I did not find a solution, that works with the official tika server image. To reach my goal, I created a simple Spring Boot MVC application and added the org.apache.tika:tika-parsers dependency.

    Now I can send multipart requests with an attached InputStream to this service which returns the content type.