@Bean ServletRegistrationBean camelServlet() { // TODO: Camel 2.19 should support this OOTB // use a @Bean to register the Camel servlet which we need to do // because we want to use the camel-servlet component for the Camel REST service ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); // CamelHttpTransportServlet is the name of the Camel servlet to use mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/api/*"); return mapping; }
@Bean ServletRegistrationBean camelServlet() { // use a @Bean to register the Camel servlet which we need to do // because we want to use the camel-servlet component for the Camel REST service ServletRegistrationBean mapping = new ServletRegistrationBean(); mapping.setName("CamelServlet"); mapping.setLoadOnStartup(1); mapping.setServlet(new CamelHttpTransportServlet()); mapping.addUrlMappings("/camel/*"); return mapping; }
@Bean public ServletRegistrationBean servletRegistrationBean() { ServletRegistrationBean registration = new ServletRegistrationBean(new CamelHttpTransportServlet(), CAMEL_URL_MAPPING); registration.setName(CAMEL_SERVLET_NAME); return registration; }
@Bean public ServletRegistrationBean camelServlet() { ServletRegistrationBean registration = new ServletRegistrationBean(new CamelHttpTransportServlet(), "/camel/*"); registration.setName("CamelServlet"); return registration; }