How to start OSGi bundle in different port in karaf with jetty -
I have several OSGI bundles and want to make those bundles separate from the port. Basically the bundles have REST API and I would like to run the APIs in different ports.
In my REST API bundle jar, there are jacksers: server configuration.
& lt; Jaxrs: server id = "services" address = "/ logger" & gt; & Lt; / Jaxrs: server & gt;
I can start several connectors with the configuration below.
& lt; Call name = "add connector" & gt; & Lt; Arg & gt; & Lt; New orbit = "org.eclipse.jetty.server.nio.SelectChannelConnector" & gt; & Lt; Set name = "host" & gt; & Lt; Property Name = "Jetty Host" /> & Lt; / Set & gt; & Lt; Set name = "port" & gt; & Lt; Property Name = "Jettie.port" default = "8282" /> & Lt; / Set & gt; & Lt; Set name = "max idle time" & gt; 300000 & lt; / Set & gt; & Lt; Set name = "acceptor" & gt; 2 & lt; / Set & gt; & Lt; Set name = "statsOn" & gt; Wrong & lt; / Set & gt; & Lt; Set name = "confidential port" & gt; 8443 & lt; / Set & gt; & Lt; Set name = "less resource source connection" & gt; 20000 & lt; / Set & gt; & Lt; Set name = "lowResourcesMaxIdleTime" & gt; 5000 & lt; / Set & gt; & Lt; Set name = "name" & gt; Jettison Con 2 & lt; / Set & gt; & Lt; / New & gt; & Lt; / Arg> & Lt; / Call & gt;
Yes, until your jackers are served by various servlets, they have been configured Different web application bundles (WAB) require you to ensure that all your bundles have the necessary headers:
WebConnect-path: / logger web-connectors: jettyConn2
As long as your jaxrs are a central sublette of the framework that registered with their own WebContext-Path That is, it should work for you.
Comments
Post a Comment