Search code examples
javacorsignite

How do I resolve CORS in Apache Ignite?


I have an Apache Ignite server running in a basic Java application. The Ignite REST api is exposed on a certain port. When I hit it from the browser, it is returning the desired response. However, from an Angular app, I am getting CORS error.

Is there any solution to this? Note that this application runs Ignite REST api (the one which is giving the CORS). How do I allow cross-origins inside the Ignite REST api?


Solution

  • Unfortunately I haven't heard about the right way to achieve that. CORS filtration in Jetty is configurable through Servlet filtration API. This functionality is provided by ServletHandler. It seems that Ignite utilizes its own Handler to serve HTTP requests. As far as I understand it doesn't support cross-domain requests.

    In general I don't think that it's good idea to direct HTTP request to an Ignite cluster from a browser. It doesn't look absolutely secure and architecturally correct. I'd prefer to have separate back-end application which should be responsible for processing of your Angular application load.